is pusher/pusher-http-php supported?
binary64 opened this issue · 4 comments
binary64 commented
Hi I'm trying to use https://github.com/pusher/pusher-http-php sending to poxa on port 8080 but it's coming back with error 500:--
Pusher: INFO: create_curl( http://pusher:8080/apps/1/events?auth_key=app_key&auth_signature=29645c46c77f795cd065d27eaadd9fa807cc1b0aa4ea10eb1e77d82bd0ab1c42&auth_timestamp=1510063399&auth_version=1.0&body_md5=c2c2bbfadfe2c025f59c2b917ae1cc15 )
Pusher: INFO: trigger POST: {"name":"test","data":"\"hello world 20171107140319\"","channels":["test"]}
Pusher: ERROR: exec_curl error:
Pusher: INFO: exec_curl response: Array
(
[body] =>
[status] => 500
)
Could it be because my client clock is different to server clock by 1 hour?
edgurgel commented
What do you see on the poxa logs?
binary64 commented
07/11/2017 14:01:4114:01:41.687 [error] Error in process <0.259.0> with exit value: {[{reason,function_clause},{mfa,{'Elixir.Poxa.WebsocketHandler',websocket_handle,3}},{stacktrace,[{'Elixir.JSEX.Decoder',format_key,[<<5 bytes>>,{config,binary,false}],[{file,"lib/jsex.ex"},{line,101}]},{'Elixir.JSEX.Decoder',handle_event...
07/11/2017 14:01:41
07/11/2017 14:01:41
07/11/2017 14:01:42
07/11/2017 14:01:4214:01:42.154 [error] Ranch listener :http had connection process started with :cowboy_protocol:start_link/4 at #PID<0.259.0> exit with reason: {[reason: :function_clause, mfa: {Poxa.WebsocketHandler, :websocket_handle, 3}, stacktrace: [{JSEX.Decoder, :format_key, ["event", {:config, :binary, false}], [file: 'lib/jsex.ex', line: 101]}, {JSEX.Decoder, :handle_event, 2, [file: 'lib/jsex.ex', line: 97]}, {:jsx_decoder, :string, 5, [file: 'src/jsx_decoder.erl', line: 156]}, {JSEX, :decode!, 2, [file: 'lib/jsex.ex', line: 17]}, {Poxa.WebsocketHandler, :websocket_handle, 3, [file: 'lib/poxa/websocket_handler.ex', line: 57]}, {:cowboy_websocket, :handler_call, 7, [file: 'src/cowboy_websocket.erl', line: 588]}, {:cowboy_protocol, :execute, 4, [file: 'src/cowboy_protocol.erl', line: 442]}], msg: {:text, "{\"event\":\"pusher:subscribe\",\"data\":{\"channel\":\"test\"}}"}, req: [socket: #Port<0.5773>, transport: :ranch_tcp, connection: :keepalive, pid: #PID<0.259.0>, method: "GET", version: :"HTTP/1.1", peer: {{192, 168, 33, 1}, 41210}, host: "192.168.33.10", host_info: :undefined, port: 8080, path: "/app/app_key", path_info: :undefined, qs: "protocol=7&client=js&version=4.2.1&flash=false", qs_vals: [{"protocol", "7"}, {"client", "js"}, {"version", "4.2.1"}, {"flash", "false"}], bindings: [app_key: "app_key"], headers: [{"host", "192.168.33.10:8080"}, {"connection", "Upgrade"}, {"pragma", "no-cache"}, {"cache-control", "no-cache"}, {"upgrade", "websocket"}, {"origin", "http://192.168.33.10:886"}, {"sec-websocket-version", "13"}, {"user-agent", "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36"}, {"dnt", "1"}, {"accept-encoding", "gzip, deflate"}, {"accept-language", "en-GB,en;q=0.8"}, {"cookie", "wp-settings-time-1=1508139155; lang=en-GB; pmaCookieVer=5; pma_lang=en; pma_collation_connection=utf8mb4_unicode_ci; pmaUser-1=%7B%22iv%22%3A%228KsrbfZbXxe16jLat1IU6A%3D%3D%22%2C%22mac%22%3A%224aa2144c4d75e5ea7ca9d6c08cfae09945f2947c%22%2C%22payload%22%3A%22fBUZmwHPOC1tvRPNBou7lg%3D%3D%22%7D; PL=rancher; CSRF=E0DE649673"}, {"sec-websocket-key", "EeLabWXfIsRjDCCRubRnnw=="}, {"sec-websocket-extensions", "permessage-deflate; client_max_window_bits"}], p_headers: [{"sec-websocket-extensions", [{"permessage-deflate", ["client_max_window_bits"]}]}, {"upgrade", ["websocket"]}, {"connection", ["upgrade"]}], cookies: :undefined, meta: [websocket_version: 13, websocket_compress: false], body_state: :waiting, buffer: "", multipart: :undefined, resp_compress: false, resp_state: :done, resp_headers: [], resp_body: "", onresponse: :undefined], state: %Poxa.WebsocketHandler.State{socket_id: "2e1f51f4-c3c4-11e7-b979-020c2652d375", time: 1510063301}], [{:cowboy_protocol, :execute, 4, [file: 'src/cowboy_protocol.erl', line: 442]}]}
07/11/2017 14:01:42
07/11/2017 14:01:42
07/11/2017 14:01:4214:01:42.413 [error] Ranch listener :http had connection process started with :cowboy_protocol:start_link/4 at #PID<0.260.0> exit with reason: {[reason: :function_clause, mfa: {Poxa.EventHandler, :handle, 2}, stacktrace: [{JSEX.Decoder, :format_key, ["name", {:config, :binary, false}], [file: 'lib/jsex.ex', line: 101]}, {JSEX.Decoder, :handle_event, 2, [file: 'lib/jsex.ex', line: 97]}, {:jsx_decoder, :string, 5, [file: 'src/jsx_decoder.erl', line: 156]}, {JSEX, :decode!, 2, [file: 'lib/jsex.ex', line: 17]}, {Poxa.EventHandler, :handle, 2, [file: 'lib/poxa/event_handler.ex', line: 43]}, {:cowboy_handler, :handler_handle, 4, [file: 'src/cowboy_handler.erl', line: 111]}, {:cowboy_protocol, :execute, 4, [file: 'src/cowboy_protocol.erl', line: 442]}], req: [socket: #Port<0.6161>, transport: :ranch_tcp, connection: :keepalive, pid: #PID<0.260.0>, method: "POST", version: :"HTTP/1.1", peer: {{10, 42, 35, 194}, 55874}, host: "pusher", host_info: :undefined, port: 8080, path: "/apps/1/events", path_info: :undefined, qs: "auth_key=app_key&auth_signature=f104a846c181f8611134c17adeac9a8d230fd86c901f5cf0aaf722c01abb320f&auth_timestamp=1510063302&auth_version=1.0&body_md5=defa2c0e98bb56c8b226010a2343681f", qs_vals: :undefined, bindings: [app_id: "1"], headers: [{"host", "pusher:8080"}, {"accept", "*/*"}, {"content-type", "application/json"}, {"x-pusher-library", "pusher-http-php 3.0.0"}, {"content-length", "75"}], p_headers: [{"content-length", 75}, {"expect", :undefined}], cookies: :undefined, meta: [], body_state: :done, buffer: "", multipart: :undefined, resp_compress: false, resp_state: :waiting, resp_headers: [], resp_body: "", onresponse: :undefined], state: "{\"name\":\"test\",\"data\":\"\\\"hello world 20171107140142\\\"\",\"channels\":[\"test\"]}"], [{:cowboy_protocol, :execute, 4, [file: 'src/cowboy_protocol.erl', line: 442]}]}
07/11/2017 14:01:42
07/11/2017 14:01:42
07/11/2017 14:01:4214:01:42.413 [error] Error in process <0.260.0> with exit value: {[{reason,function_clause},{mfa,{'Elixir.Poxa.EventHandler',handle,2}},{stacktrace,[{'Elixir.JSEX.Decoder',format_key,[<<4 bytes>>,{config,binary,false}],[{file,"lib/jsex.ex"},{line,101}]},{'Elixir.JSEX.Decoder',handle_event,2,[{file...
07/11/2017 14:01:42
07/11/2017 14:01:42
07/11/2017 14:01:42
07/11/2017 14:01:4214:01:42.682 [error] Error in process <0.261.0> with exit value: {[{reason,function_clause},{mfa,{'Elixir.Poxa.WebsocketHandler',websocket_handle,3}},{stacktrace,[{'Elixir.JSEX.Decoder',format_key,[<<5 bytes>>,{config,binary,false}],[{file,"lib/jsex.ex"},{line,101}]},{'Elixir.JSEX.Decoder',handle_event...
07/11/2017 14:01:42
07/11/2017 14:01:42
07/11/2017 14:01:42
07/11/2017 14:01:4214:01:42.696 [error] Ranch listener :http had connection process started with :cowboy_protocol:start_link/4 at #PID<0.261.0> exit with reason: {[reason: :function_clause, mfa: {Poxa.WebsocketHandler, :websocket_handle, 3}, stacktrace: [{JSEX.Decoder, :format_key, ["event", {:config, :binary, false}], [file: 'lib/jsex.ex', line: 101]}, {JSEX.Decoder, :handle_event, 2, [file: 'lib/jsex.ex', line: 97]}, {:jsx_decoder, :string, 5, [file: 'src/jsx_decoder.erl', line: 156]}, {JSEX, :decode!, 2, [file: 'lib/jsex.ex', line: 17]}, {Poxa.WebsocketHandler, :websocket_handle, 3, [file: 'lib/poxa/websocket_handler.ex', line: 57]}, {:cowboy_websocket, :handler_call, 7, [file: 'src/cowboy_websocket.erl', line: 588]}, {:cowboy_protocol, :execute, 4, [file: 'src/cowboy_protocol.erl', line: 442]}], msg: {:text, "{\"event\":\"pusher:subscribe\",\"data\":{\"channel\":\"test\"}}"}, req: [socket: #Port<0.6162>, transport: :ranch_tcp, connection: :keepalive, pid: #PID<0.261.0>, method: "GET", version: :"HTTP/1.1", peer: {{192, 168, 33, 1}, 41229}, host: "192.168.33.10", host_info: :undefined, port: 8080, path: "/app/app_key", path_info: :undefined, qs: "protocol=7&client=js&version=4.2.1&flash=false", qs_vals: [{"protocol", "7"}, {"client", "js"}, {"version", "4.2.1"}, {"flash", "false"}], bindings: [app_key: "app_key"], headers: [{"host", "192.168.33.10:8080"}, {"connection", "Upgrade"}, {"pragma", "no-cache"}, {"cache-control", "no-cache"}, {"upgrade", "websocket"}, {"origin", "http://192.168.33.10:886"}, {"sec-websocket-version", "13"}, {"user-agent", "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36"}, {"dnt", "1"}, {"accept-encoding", "gzip, deflate"}, {"accept-language", "en-GB,en;q=0.8"}, {"cookie", "wp-settings-time-1=1508139155; lang=en-GB; pmaCookieVer=5; pma_lang=en; pma_collation_connection=utf8mb4_unicode_ci; pmaUser-1=%7B%22iv%22%3A%228KsrbfZbXxe16jLat1IU6A%3D%3D%22%2C%22mac%22%3A%224aa2144c4d75e5ea7ca9d6c08cfae09945f2947c%22%2C%22payload%22%3A%22fBUZmwHPOC1tvRPNBou7lg%3D%3D%22%7D; PL=rancher; CSRF=E0DE649673"}, {"sec-websocket-key", "GzrPbFbYlKzowuGP4DEOSQ=="}, {"sec-websocket-extensions", "permessage-deflate; client_max_window_bits"}], p_headers: [{"sec-websocket-extensions", [{"permessage-deflate", ["client_max_window_bits"]}]}, {"upgrade", ["websocket"]}, {"connection", ["upgrade"]}], cookies: :undefined, meta: [websocket_version: 13, websocket_compress: false], body_state: :waiting, buffer: "", multipart: :undefined, resp_compress: false, resp_state: :done, resp_headers: [], resp_body: "", onresponse: :undefined], state: %Poxa.WebsocketHandler.State{socket_id: "2ef33172-c3c4-11e7-93a1-020c2652d375", time: 1510063302}], [{:cowboy_protocol, :execute, 4, [file: 'src/cowboy_protocol.erl', line: 442]}]}
07/11/2017 14:01:42
07/11/2017 14:01:44
07/11/2017 14:01:4414:01:44.018 [error] Error in process <0.262.0> with exit value: {[{reason,function_clause},{mfa,{'Elixir.Poxa.EventHandler',handle,2}},{stacktrace,[{'Elixir.JSEX.Decoder',format_key,[<<4 bytes>>,{config,binary,false}],[{file,"lib/jsex.ex"},{line,101}]},{'Elixir.JSEX.Decoder',handle_event,2,[{file...
07/11/2017 14:01:44
07/11/2017 14:01:44
07/11/2017 14:01:44
07/11/2017 14:01:4414:01:44.021 [error] Ranch listener :http had connection process started with :cowboy_protocol:start_link/4 at #PID<0.262.0> exit with reason: {[reason: :function_clause, mfa: {Poxa.EventHandler, :handle, 2}, stacktrace: [{JSEX.Decoder, :format_key, ["name", {:config, :binary, false}], [file: 'lib/jsex.ex', line: 101]}, {JSEX.Decoder, :handle_event, 2, [file: 'lib/jsex.ex', line: 97]}, {:jsx_decoder, :string, 5, [file: 'src/jsx_decoder.erl', line: 156]}, {JSEX, :decode!, 2, [file: 'lib/jsex.ex', line: 17]}, {Poxa.EventHandler, :handle, 2, [file: 'lib/poxa/event_handler.ex', line: 43]}, {:cowboy_handler, :handler_handle, 4, [file: 'src/cowboy_handler.erl', line: 111]}, {:cowboy_protocol, :execute, 4, [file: 'src/cowboy_protocol.erl', line: 442]}], req: [socket: #Port<0.6241>, transport: :ranch_tcp, connection: :keepalive, pid: #PID<0.262.0>, method: "POST", version: :"HTTP/1.1", peer: {{10, 42, 35, 194}, 55892}, host: "pusher", host_info: :undefined, port: 8080, path: "/apps/1/events", path_info: :undefined, qs: "auth_key=app_key&auth_signature=ff34a94d8f2c0e08024a0526e8dde2bb33f3c273f326c4adc3325d4d236c724f&auth_timestamp=1510063304&auth_version=1.0&body_md5=0e833429d9d8515ba5537000a122d363", qs_vals: :undefined, bindings: [app_id: "1"], headers: [{"host", "pusher:8080"}, {"accept", "*/*"}, {"content-type", "application/json"}, {"x-pusher-library", "pusher-http-php 3.0.0"}, {"content-length", "75"}], p_headers: [{"content-length", 75}, {"expect", :undefined}], cookies: :undefined, meta: [], body_state: :done, buffer: "", multipart: :undefined, resp_compress: false, resp_state: :waiting, resp_headers: [], resp_body: "", onresponse: :undefined], state: "{\"name\":\"test\",\"data\":\"\\\"hello world 20171107140144\\\"\",\"channels\":[\"test\"]}"], [{:cowboy_protocol, :execute, 4, [file: 'src/cowboy_protocol.erl', line: 442]}]}
07/11/2017 14:01:44
07/11/2017 14:03:19
07/11/2017 14:03:1914:03:19.984 [error] Error in process <0.263.0> with exit value: {[{reason,function_clause},{mfa,{'Elixir.Poxa.EventHandler',handle,2}},{stacktrace,[{'Elixir.JSEX.Decoder',format_key,[<<4 bytes>>,{config,binary,false}],[{file,"lib/jsex.ex"},{line,101}]},{'Elixir.JSEX.Decoder',handle_event,2,[{file...
07/11/2017 14:03:19
07/11/2017 14:03:19
07/11/2017 14:03:19
07/11/2017 14:03:1914:03:19.986 [error] Ranch listener :http had connection process started with :cowboy_protocol:start_link/4 at #PID<0.263.0> exit with reason: {[reason: :function_clause, mfa: {Poxa.EventHandler, :handle, 2}, stacktrace: [{JSEX.Decoder, :format_key, ["name", {:config, :binary, false}], [file: 'lib/jsex.ex', line: 101]}, {JSEX.Decoder, :handle_event, 2, [file: 'lib/jsex.ex', line: 97]}, {:jsx_decoder, :string, 5, [file: 'src/jsx_decoder.erl', line: 156]}, {JSEX, :decode!, 2, [file: 'lib/jsex.ex', line: 17]}, {Poxa.EventHandler, :handle, 2, [file: 'lib/poxa/event_handler.ex', line: 43]}, {:cowboy_handler, :handler_handle, 4, [file: 'src/cowboy_handler.erl', line: 111]}, {:cowboy_protocol, :execute, 4, [file: 'src/cowboy_protocol.erl', line: 442]}], req: [socket: #Port<0.6242>, transport: :ranch_tcp, connection: :keepalive, pid: #PID<0.263.0>, method: "POST", version: :"HTTP/1.1", peer: {{10, 42, 35, 194}, 56554}, host: "pusher", host_info: :undefined, port: 8080, path: "/apps/1/events", path_info: :undefined, qs: "auth_key=app_key&auth_signature=29645c46c77f795cd065d27eaadd9fa807cc1b0aa4ea10eb1e77d82bd0ab1c42&auth_timestamp=1510063399&auth_version=1.0&body_md5=c2c2bbfadfe2c025f59c2b917ae1cc15", qs_vals: :undefined, bindings: [app_id: "1"], headers: [{"host", "pusher:8080"}, {"accept", "*/*"}, {"content-type", "application/json"}, {"x-pusher-library", "pusher-http-php 3.0.0"}, {"content-length", "75"}], p_headers: [{"content-length", 75}, {"expect", :undefined}], cookies: :undefined, meta: [], body_state: :done, buffer: "", multipart: :undefined, resp_compress: false, resp_state: :waiting, resp_headers: [], resp_body: "", onresponse: :undefined], state: "{\"name\":\"test\",\"data\":\"\\\"hello world 20171107140319\\\"\",\"channels\":[\"test\"]}"], [{:cowboy_protocol, :execute, 4, [file: 'src/cowboy_protocol.erl', line: 442]}]}
07/11/2017 14:03:19
07/11/2017 14:06:57
07/11/2017 14:06:5714:06:57.987 [error] Error in process <0.264.0> with exit value: {[{reason,function_clause},{mfa,{'Elixir.Poxa.WebsocketHandler',websocket_handle,3}},{stacktrace,[{'Elixir.JSEX.Decoder',format_key,[<<5 bytes>>,{config,binary,false}],[{file,"lib/jsex.ex"},{line,101}]},{'Elixir.JSEX.Decoder',handle_event...
07/11/2017 14:06:57
07/11/2017 14:06:57
07/11/2017 14:06:58
07/11/2017 14:06:5814:06:58.030 [error] Ranch listener :http had connection process started with :cowboy_protocol:start_link/4 at #PID<0.264.0> exit with reason: {[reason: :function_clause, mfa: {Poxa.WebsocketHandler, :websocket_handle, 3}, stacktrace: [{JSEX.Decoder, :format_key, ["event", {:config, :binary, false}], [file: 'lib/jsex.ex', line: 101]}, {JSEX.Decoder, :handle_event, 2, [file: 'lib/jsex.ex', line: 97]}, {:jsx_decoder, :string, 5, [file: 'src/jsx_decoder.erl', line: 156]}, {JSEX, :decode!, 2, [file: 'lib/jsex.ex', line: 17]}, {Poxa.WebsocketHandler, :websocket_handle, 3, [file: 'lib/poxa/websocket_handler.ex', line: 57]}, {:cowboy_websocket, :handler_call, 7, [file: 'src/cowboy_websocket.erl', line: 588]}, {:cowboy_protocol, :execute, 4, [file: 'src/cowboy_protocol.erl', line: 442]}], msg: {:text, "{\"event\":\"pusher:subscribe\",\"data\":{\"channel\":\"test\"}}"}, req: [socket: #Port<0.6243>, transport: :ranch_tcp, connection: :keepalive, pid: #PID<0.264.0>, method: "GET", version: :"HTTP/1.1", peer: {{192, 168, 33, 1}, 45945}, host: "192.168.33.10", host_info: :undefined, port: 8080, path: "/app/app_key", path_info: :undefined, qs: "protocol=7&client=js&version=4.2.1&flash=false", qs_vals: [{"protocol", "7"}, {"client", "js"}, {"version", "4.2.1"}, {"flash", "false"}], bindings: [app_key: "app_key"], headers: [{"host", "192.168.33.10:8080"}, {"connection", "Upgrade"}, {"pragma", "no-cache"}, {"cache-control", "no-cache"}, {"upgrade", "websocket"}, {"origin", "http://192.168.33.10:886"}, {"sec-websocket-version", "13"}, {"user-agent", "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36"}, {"dnt", "1"}, {"accept-encoding", "gzip, deflate"}, {"accept-language", "en-GB,en;q=0.8"}, {"cookie", "wp-settings-time-1=1508139155; lang=en-GB; pmaCookieVer=5; pma_lang=en; pma_collation_connection=utf8mb4_unicode_ci; pmaUser-1=%7B%22iv%22%3A%228KsrbfZbXxe16jLat1IU6A%3D%3D%22%2C%22mac%22%3A%224aa2144c4d75e5ea7ca9d6c08cfae09945f2947c%22%2C%22payload%22%3A%22fBUZmwHPOC1tvRPNBou7lg%3D%3D%22%7D; PL=rancher; CSRF=E0DE649673"}, {"sec-websocket-key", "xSdeTu/cuNi1iuMyBqw4RQ=="}, {"sec-websocket-extensions", "permessage-deflate; client_max_window_bits"}], p_headers: [{"sec-websocket-extensions", [{"permessage-deflate", ["client_max_window_bits"]}]}, {"upgrade", ["websocket"]}, {"connection", ["upgrade"]}], cookies: :undefined, meta: [websocket_version: 13, websocket_compress: false], body_state: :waiting, buffer: "", multipart: :undefined, resp_compress: false, resp_state: :done, resp_headers: [], resp_body: "", onresponse: :undefined], state: %Poxa.WebsocketHandler.State{socket_id: "eab1d17a-c3c4-11e7-8fad-020c2652d375", time: 1510063617}], [{:cowboy_protocol, :execute, 4, [file: 'src/cowboy_protocol.erl', line: 442]}]}
07/11/2017 14:06:58
07/11/2017 14:06:59
07/11/2017 14:06:5914:06:59.034 [error] Error in process <0.265.0> with exit value: {[{reason,function_clause},{mfa,{'Elixir.Poxa.WebsocketHandler',websocket_handle,3}},{stacktrace,[{'Elixir.JSEX.Decoder',format_key,[<<5 bytes>>,{config,binary,false}],[{file,"lib/jsex.ex"},{line,101}]},{'Elixir.JSEX.Decoder',handle_event...
07/11/2017 14:06:59
07/11/2017 14:06:59
07/11/2017 14:06:59
07/11/2017 14:06:5914:06:59.043 [error] Ranch listener :http had connection process started with :cowboy_protocol:start_link/4 at #PID<0.265.0> exit with reason: {[reason: :function_clause, mfa: {Poxa.WebsocketHandler, :websocket_handle, 3}, stacktrace: [{JSEX.Decoder, :format_key, ["event", {:config, :binary, false}], [file: 'lib/jsex.ex', line: 101]}, {JSEX.Decoder, :handle_event, 2, [file: 'lib/jsex.ex', line: 97]}, {:jsx_decoder, :string, 5, [file: 'src/jsx_decoder.erl', line: 156]}, {JSEX, :decode!, 2, [file: 'lib/jsex.ex', line: 17]}, {Poxa.WebsocketHandler, :websocket_handle, 3, [file: 'lib/poxa/websocket_handler.ex', line: 57]}, {:cowboy_websocket, :handler_call, 7, [file: 'src/cowboy_websocket.erl', line: 588]}, {:cowboy_protocol, :execute, 4, [file: 'src/cowboy_protocol.erl', line: 442]}], msg: {:text, "{\"event\":\"pusher:subscribe\",\"data\":{\"channel\":\"test\"}}"}, req: [socket: #Port<0.6322>, transport: :ranch_tcp, connection: :keepalive, pid: #PID<0.265.0>, method: "GET", version: :"HTTP/1.1", peer: {{192, 168, 33, 1}, 45946}, host: "192.168.33.10", host_info: :undefined, port: 8080, path: "/app/app_key", path_info: :undefined, qs: "protocol=7&client=js&version=4.2.1&flash=false", qs_vals: [{"protocol", "7"}, {"client", "js"}, {"version", "4.2.1"}, {"flash", "false"}], bindings: [app_key: "app_key"], headers: [{"host", "192.168.33.10:8080"}, {"connection", "Upgrade"}, {"pragma", "no-cache"}, {"cache-control", "no-cache"}, {"upgrade", "websocket"}, {"origin", "http://192.168.33.10:886"}, {"sec-websocket-version", "13"}, {"user-agent", "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36"}, {"dnt", "1"}, {"accept-encoding", "gzip, deflate"}, {"accept-language", "en-GB,en;q=0.8"}, {"cookie", "wp-settings-time-1=1508139155; lang=en-GB; pmaCookieVer=5; pma_lang=en; pma_collation_connection=utf8mb4_unicode_ci; pmaUser-1=%7B%22iv%22%3A%228KsrbfZbXxe16jLat1IU6A%3D%3D%22%2C%22mac%22%3A%224aa2144c4d75e5ea7ca9d6c08cfae09945f2947c%22%2C%22payload%22%3A%22fBUZmwHPOC1tvRPNBou7lg%3D%3D%22%7D; PL=rancher; CSRF=E0DE649673"}, {"sec-websocket-key", "yORUJkqIBWPMv+FujS5xow=="}, {"sec-websocket-extensions", "permessage-deflate; client_max_window_bits"}], p_headers: [{"sec-websocket-extensions", [{"permessage-deflate", ["client_max_window_bits"]}]}, {"upgrade", ["websocket"]}, {"connection", ["upgrade"]}], cookies: :undefined, meta: [websocket_version: 13, websocket_compress: false], body_state: :waiting, buffer: "", multipart: :undefined, resp_compress: false, resp_state: :done, resp_headers: [], resp_body: "", onresponse: :undefined], state: %Poxa.WebsocketHandler.State{socket_id: "eb827d16-c3c4-11e7-bc26-020c2652d375", time: 1510063619}], [{:cowboy_protocol, :execute, 4, [file: 'src/cowboy_protocol.erl', line: 442]}]}
07/11/2017 14:06:59
07/11/2017 14:06:59
07/11/2017 14:06:5914:06:59.263 [error] Ranch listener :http had connection process started with :cowboy_protocol:start_link/4 at #PID<0.266.0> exit with reason: {[reason: :function_clause, mfa: {Poxa.EventHandler, :handle, 2}, stacktrace: [{JSEX.Decoder, :format_key, ["name", {:config, :binary, false}], [file: 'lib/jsex.ex', line: 101]}, {JSEX.Decoder, :handle_event, 2, [file: 'lib/jsex.ex', line: 97]}, {:jsx_decoder, :string, 5, [file: 'src/jsx_decoder.erl', line: 156]}, {JSEX, :decode!, 2, [file: 'lib/jsex.ex', line: 17]}, {Poxa.EventHandler, :handle, 2, [file: 'lib/poxa/event_handler.ex', line: 43]}, {:cowboy_handler, :handler_handle, 4, [file: 'src/cowboy_handler.erl', line: 111]}, {:cowboy_protocol, :execute, 4, [file: 'src/cowboy_protocol.erl', line: 442]}], req: [socket: #Port<0.6401>, transport: :ranch_tcp, connection: :keepalive, pid: #PID<0.266.0>, method: "POST", version: :"HTTP/1.1", peer: {{10, 42, 35, 194}, 57994}, host: "pusher", host_info: :undefined, port: 8080, path: "/apps/1/events", path_info: :undefined, qs: "auth_key=app_key&auth_signature=8924e00f445c55b8dd10235951182f1ae6ad50f09e0add5e4c74dba1b1d807de&auth_timestamp=1510063619&auth_version=1.0&body_md5=a4d223904a9e9f5ddbb017fb4f46889c", qs_vals: :undefined, bindings: [app_id: "1"], headers: [{"host", "pusher:8080"}, {"accept", "*/*"}, {"content-type", "application/json"}, {"x-pusher-library", "pusher-http-php 3.0.0"}, {"content-length", "75"}], p_headers: [{"content-length", 75}, {"expect", :undefined}], cookies: :undefined, meta: [], body_state: :done, buffer: "", multipart: :undefined, resp_compress: false, resp_state: :waiting, resp_headers: [], resp_body: "", onresponse: :undefined], state: "{\"name\":\"test\",\"data\":\"\\\"hello world 20171107140659\\\"\",\"channels\":[\"test\"]}"], [{:cowboy_protocol, :execute, 4, [file: 'src/cowboy_protocol.erl', line: 442]}]}
07/11/2017 14:06:59
07/11/2017 14:06:59
07/11/2017 14:06:5914:06:59.264 [error] Error in process <0.266.0> with exit value: {[{reason,function_clause},{mfa,{'Elixir.Poxa.EventHandler',handle,2}},{stacktrace,[{'Elixir.JSEX.Decoder',format_key,[<<4 bytes>>,{config,binary,false}],[{file,"lib/jsex.ex"},{line,101}]},{'Elixir.JSEX.Decoder',handle_event,2,[{file...
07/11/2017 14:06:59
07/11/2017 14:06:59
07/11/2017 14:13:30
07/11/2017 14:13:3014:13:30.560 [error] Error in process <0.267.0> with exit value: {[{reason,function_clause},{mfa,{'Elixir.Poxa.WebsocketHandler',websocket_handle,3}},{stacktrace,[{'Elixir.JSEX.Decoder',format_key,[<<5 bytes>>,{config,binary,false}],[{file,"lib/jsex.ex"},{line,101}]},{'Elixir.JSEX.Decoder',handle_event...
07/11/2017 14:13:30
07/11/2017 14:13:30
07/11/2017 14:13:30
07/11/2017 14:13:3014:13:30.582 [error] Ranch listener :http had connection process started with :cowboy_protocol:start_link/4 at #PID<0.267.0> exit with reason: {[reason: :function_clause, mfa: {Poxa.WebsocketHandler, :websocket_handle, 3}, stacktrace: [{JSEX.Decoder, :format_key, ["event", {:config, :binary, false}], [file: 'lib/jsex.ex', line: 101]}, {JSEX.Decoder, :handle_event, 2, [file: 'lib/jsex.ex', line: 97]}, {:jsx_decoder, :string, 5, [file: 'src/jsx_decoder.erl', line: 156]}, {JSEX, :decode!, 2, [file: 'lib/jsex.ex', line: 17]}, {Poxa.WebsocketHandler, :websocket_handle, 3, [file: 'lib/poxa/websocket_handler.ex', line: 57]}, {:cowboy_websocket, :handler_call, 7, [file: 'src/cowboy_websocket.erl', line: 588]}, {:cowboy_protocol, :execute, 4, [file: 'src/cowboy_protocol.erl', line: 442]}], msg: {:text, "{\"event\":\"pusher:subscribe\",\"data\":{\"channel\":\"test\"}}"}, req: [socket: #Port<0.6402>, transport: :ranch_tcp, connection: :keepalive, pid: #PID<0.267.0>, method: "GET", version: :"HTTP/1.1", peer: {{192, 168, 33, 1}, 51391}, host: "192.168.33.10", host_info: :undefined, port: 8080, path: "/app/app_key", path_info: :undefined, qs: "protocol=7&client=js&version=4.2.1&flash=false", qs_vals: [{"protocol", "7"}, {"client", "js"}, {"version", "4.2.1"}, {"flash", "false"}], bindings: [app_key: "app_key"], headers: [{"host", "192.168.33.10:8080"}, {"connection", "Upgrade"}, {"pragma", "no-cache"}, {"cache-control", "no-cache"}, {"upgrade", "websocket"}, {"origin", "http://192.168.33.10:886"}, {"sec-websocket-version", "13"}, {"user-agent", "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36"}, {"dnt", "1"}, {"accept-encoding", "gzip, deflate"}, {"accept-language", "en-GB,en;q=0.8"}, {"cookie", "wp-settings-time-1=1508139155; lang=en-GB; pmaCookieVer=5; pma_lang=en; pma_collation_connection=utf8mb4_unicode_ci; pmaUser-1=%7B%22iv%22%3A%228KsrbfZbXxe16jLat1IU6A%3D%3D%22%2C%22mac%22%3A%224aa2144c4d75e5ea7ca9d6c08cfae09945f2947c%22%2C%22payload%22%3A%22fBUZmwHPOC1tvRPNBou7lg%3D%3D%22%7D; PL=rancher; CSRF=E0DE649673"}, {"sec-websocket-key", "Z0IRpb37MrkWm3YOHeHOAg=="}, {"sec-websocket-extensions", "permessage-deflate; client_max_window_bits"}], p_headers: [{"sec-websocket-extensions", [{"permessage-deflate", ["client_max_window_bits"]}]}, {"upgrade", ["websocket"]}, {"connection", ["upgrade"]}], cookies: :undefined, meta: [websocket_version: 13, websocket_compress: false], body_state: :waiting, buffer: "", multipart: :undefined, resp_compress: false, resp_state: :done, resp_headers: [], resp_body: "", onresponse: :undefined], state: %Poxa.WebsocketHandler.State{socket_id: "d4a50428-c3c5-11e7-8572-020c2652d375", time: 1510064010}], [{:cowboy_protocol, :execute, 4, [file: 'src/cowboy_protocol.erl', line: 442]}]}
07/11/2017 14:13:30
07/11/2017 14:13:31
07/11/2017 14:13:3114:13:31.498 [error] Error in process <0.268.0> with exit value: {[{reason,function_clause},{mfa,{'Elixir.Poxa.EventHandler',handle,2}},{stacktrace,[{'Elixir.JSEX.Decoder',format_key,[<<4 bytes>>,{config,binary,false}],[{file,"lib/jsex.ex"},{line,101}]},{'Elixir.JSEX.Decoder',handle_event,2,[{file...
07/11/2017 14:13:31
07/11/2017 14:13:31
07/11/2017 14:13:31
07/11/2017 14:13:3114:13:31.515 [error] Ranch listener :http had connection process started with :cowboy_protocol:start_link/4 at #PID<0.268.0> exit with reason: {[reason: :function_clause, mfa: {Poxa.EventHandler, :handle, 2}, stacktrace: [{JSEX.Decoder, :format_key, ["name", {:config, :binary, false}], [file: 'lib/jsex.ex', line: 101]}, {JSEX.Decoder, :handle_event, 2, [file: 'lib/jsex.ex', line: 97]}, {:jsx_decoder, :string, 5, [file: 'src/jsx_decoder.erl', line: 156]}, {JSEX, :decode!, 2, [file: 'lib/jsex.ex', line: 17]}, {Poxa.EventHandler, :handle, 2, [file: 'lib/poxa/event_handler.ex', line: 43]}, {:cowboy_handler, :handler_handle, 4, [file: 'src/cowboy_handler.erl', line: 111]}, {:cowboy_protocol, :execute, 4, [file: 'src/cowboy_protocol.erl', line: 442]}], req: [socket: #Port<0.6481>, transport: :ranch_tcp, connection: :keepalive, pid: #PID<0.268.0>, method: "POST", version: :"HTTP/1.1", peer: {{10, 42, 35, 194}, 60606}, host: "pusher", host_info: :undefined, port: 8080, path: "/apps/app_id/events", path_info: :undefined, qs: "auth_key=app_key&auth_signature=7f7940315d8794ebfe58386367e039b23617b0687cd508e425e5e3c6edf65e33&auth_timestamp=1510064011&auth_version=1.0&body_md5=cc2cbee9a56397a6e266f86b16084373", qs_vals: :undefined, bindings: [app_id: "app_id"], headers: [{"host", "pusher:8080"}, {"accept", "*/*"}, {"content-type", "application/json"}, {"x-pusher-library", "pusher-http-php 3.0.0"}, {"content-length", "75"}], p_headers: [{"content-length", 75}, {"expect", :undefined}], cookies: :undefined, meta: [], body_state: :done, buffer: "", multipart: :undefined, resp_compress: false, resp_state: :waiting, resp_headers: [], resp_body: "", onresponse: :undefined], state: "{\"name\":\"test\",\"data\":\"\\\"hello world 20171107141331\\\"\",\"channels\":[\"test\"]}"], [{:cowboy_protocol, :execute, 4, [file: 'src/cowboy_protocol.erl', line: 442]}]}
07/11/2017 14:13:31
07/11/2017 14:13:31
07/11/2017 14:13:3114:13:31.590 [error] Error in process <0.269.0> with exit value: {[{reason,function_clause},{mfa,{'Elixir.Poxa.WebsocketHandler',websocket_handle,3}},{stacktrace,[{'Elixir.JSEX.Decoder',format_key,[<<5 bytes>>,{config,binary,false}],[{file,"lib/jsex.ex"},{line,101}]},{'Elixir.JSEX.Decoder',handle_event...
07/11/2017 14:13:31
07/11/2017 14:13:31
07/11/2017 14:13:31
07/11/2017 14:13:3114:13:31.608 [error] Ranch listener :http had connection process started with :cowboy_protocol:start_link/4 at #PID<0.269.0> exit with reason: {[reason: :function_clause, mfa: {Poxa.WebsocketHandler, :websocket_handle, 3}, stacktrace: [{JSEX.Decoder, :format_key, ["event", {:config, :binary, false}], [file: 'lib/jsex.ex', line: 101]}, {JSEX.Decoder, :handle_event, 2, [file: 'lib/jsex.ex', line: 97]}, {:jsx_decoder, :string, 5, [file: 'src/jsx_decoder.erl', line: 156]}, {JSEX, :decode!, 2, [file: 'lib/jsex.ex', line: 17]}, {Poxa.WebsocketHandler, :websocket_handle, 3, [file: 'lib/poxa/websocket_handler.ex', line: 57]}, {:cowboy_websocket, :handler_call, 7, [file: 'src/cowboy_websocket.erl', line: 588]}, {:cowboy_protocol, :execute, 4, [file: 'src/cowboy_protocol.erl', line: 442]}], msg: {:text, "{\"event\":\"pusher:subscribe\",\"data\":{\"channel\":\"test\"}}"}, req: [socket: #Port<0.6482>, transport: :ranch_tcp, connection: :keepalive, pid: #PID<0.269.0>, method: "GET", version: :"HTTP/1.1", peer: {{192, 168, 33, 1}, 51426}, host: "192.168.33.10", host_info: :undefined, port: 8080, path: "/app/app_key", path_info: :undefined, qs: "protocol=7&client=js&version=4.2.1&flash=false", qs_vals: [{"protocol", "7"}, {"client", "js"}, {"version", "4.2.1"}, {"flash", "false"}], bindings: [app_key: "app_key"], headers: [{"host", "192.168.33.10:8080"}, {"connection", "Upgrade"}, {"pragma", "no-cache"}, {"cache-control", "no-cache"}, {"upgrade", "websocket"}, {"origin", "http://192.168.33.10:886"}, {"sec-websocket-version", "13"}, {"user-agent", "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36"}, {"dnt", "1"}, {"accept-encoding", "gzip, deflate"}, {"accept-language", "en-GB,en;q=0.8"}, {"cookie", "wp-settings-time-1=1508139155; lang=en-GB; pmaCookieVer=5; pma_lang=en; pma_collation_connection=utf8mb4_unicode_ci; pmaUser-1=%7B%22iv%22%3A%228KsrbfZbXxe16jLat1IU6A%3D%3D%22%2C%22mac%22%3A%224aa2144c4d75e5ea7ca9d6c08cfae09945f2947c%22%2C%22payload%22%3A%22fBUZmwHPOC1tvRPNBou7lg%3D%3D%22%7D; PL=rancher; CSRF=E0DE649673"}, {"sec-websocket-key", "NTpr0kEdaYuppH4CqE66tw=="}, {"sec-websocket-extensions", "permessage-deflate; client_max_window_bits"}], p_headers: [{"sec-websocket-extensions", [{"permessage-deflate", ["client_max_window_bits"]}]}, {"upgrade", ["websocket"]}, {"connection", ["upgrade"]}], cookies: :undefined, meta: [websocket_version: 13, websocket_compress: false], body_state: :waiting, buffer: "", multipart: :undefined, resp_compress: false, resp_state: :done, resp_headers: [], resp_body: "", onresponse: :undefined], state: %Poxa.WebsocketHandler.State{socket_id: "d57decfc-c3c5-11e7-8d9a-020c2652d375", time: 1510064011}], [{:cowboy_protocol, :execute, 4, [file: 'src/cowboy_protocol.erl', line: 442]}]}
07/11/2017 14:13:31
my js/php:-
<?php
require_once 'vendor/autoload.php';
$app_id = 'app_id';
$app_key = 'app_key';
$app_secret = 'secret';
$app_cluster = 'pusher';
class MyLogger
{
public function log($msg)
{
var_dump($msg);
}
}
if (isset($_POST['send-test'])) {
$pusher = new Pusher\Pusher($app_key, $app_secret, $app_id, array(
'cluster' => $app_cluster,
'encrypted' => false,
'debug' => true,
//'wsHost' => $app_cluster,
//'wsPort' => 8080,
'host' => $app_cluster,
'port' => 8080
));
$pusher->set_logger( new MyLogger() );
//$pusher->wsHost = $app_cluster;
$res = $pusher->trigger('test', 'test', 'hello world ' . date("YmdHis"));
var_dump($res);
exit;
}
?>
<h1>Slanger Example</h1>
<p>Date event last received: <span id="last-date">(...)</span></p>
<button id="send-test">Send</button>
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="pusher.min.js"></script>
<script>
$(function() {
var $lastDate = $('#last-date')
var $btn = $('button#send-test').on("click", function () {
$.ajax({
method: "POST",
data: {
"send-test": "1"
}
})
})
const socket = new Pusher("<?php echo $app_key; ?>", {
cluster: "<?php echo $app_cluster;?>",
encrypted: false,
disableStats: true,
enabledTransports: ['ws'],
wsHost: "192.168.33.10",
wsPort: "8080"
});
const channel = socket.subscribe('test')
channel.bind('test', function (data) {
console.log("GOT DATA!", data)
$lastDate.text(data)
});
})
</script>
Thanks in advance!
edgurgel commented
It looks like invalid json coming from the client? Oo
edgurgel commented
The only clients I've tested are the ones written in Javascript and Ruby.