Answer the question
In order to leave comments, you need to log in
Why is there no websocket connection?
Added config to Nginx
server {
listen 8010;
location / {
proxy_pass http://mysite.ru;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
}
}
componentDidMount() {
this.socket = new WebSocket('ws://mysite.ru:8010');
this.socket.onopen = function() {
alert("Соединение установлено.");
};
...
app.js:91683 WebSocket connection to 'ws://mysite.ru:8010/' failed: Error in connection establishment: net::ERR_CONNECTION_TIMED_OUT
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question