fix issue #189 - Websocket(SSL) cannot work for emqttd_net:peername error
This commit is contained in:
parent
f4a5760dbd
commit
e59232c2ab
|
@ -102,8 +102,7 @@ reset_parser(State = #wsocket_state{packet_opts = PktOpts}) ->
|
|||
|
||||
init([WsPid, Req, ReplyChannel, PktOpts]) ->
|
||||
process_flag(trap_exit, true),
|
||||
Socket = Req:get(socket),
|
||||
{ok, Peername} = emqttd_net:peername(Socket),
|
||||
{ok, Peername} = Req:get(peername),
|
||||
SendFun = fun(Payload) -> ReplyChannel({binary, Payload}) end,
|
||||
ProtoState = emqttd_protocol:init(Peername, SendFun, PktOpts),
|
||||
{ok, #client_state{ws_pid = WsPid, request = Req, proto_state = ProtoState}}.
|
||||
|
|
Loading…
Reference in New Issue