wandenberg / nginx-push-stream-module

A pure stream http push technology for your Nginx setup. Comet made easy and really scalable.
Other
2.22k stars 295 forks source link

Connection closed before receiving a handshake response #261

Closed ghost closed 7 years ago

ghost commented 7 years ago

Salve,

i am using the js client provided by this repository (to create a websocket connection) but i am getting a "Connection closed before receiving a handshake response" error in my browser console. I really don't know what is going wrong and how to fix it. Maybe someone can have a look at my nginx.conf.

http {

    server {
        listen *:80;
        server_name localhost;

        autoindex off;

        client_max_body_size 128M;

        location /channels-stats {
          deny all;
          push_stream_channels_statistics;
          push_stream_channels_path               $arg_id;
        }

        location /pub {
          deny  all;
          push_stream_publisher admin;
          push_stream_channels_path               $arg_id;
        }

        location ~ /sub/(.*) {
          push_stream_subscriber;
          push_stream_channels_path                   $1;
        }

        location ~ /ws/(.*) {
          push_stream_subscriber websocket;
          push_stream_channels_path                   $1;
          push_stream_message_template                "~text~";
          push_stream_websocket_allow_publish         on;
          push_stream_ping_message_interval           10s;
        }

    }
}

Best regards

wandenberg commented 7 years ago

Have you tried do exactly like in this example. For the js client provided in the module the message_template matters.