Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade required #1297

Closed
ghost opened this issue Feb 7, 2018 · 1 comment
Closed

Upgrade required #1297

ghost opened this issue Feb 7, 2018 · 1 comment

Comments

@ghost
Copy link

ghost commented Feb 7, 2018

Thank you for your sharing of the "ws" module. It helps me done the web app with websocket. It worked for one year, but it suddenly not working from these few days. It shows "Upgrade required" when I am accessing the page. Does anyone has ideas or experience for this issue? Thanks.

@lpinca
Copy link
Member

lpinca commented Feb 7, 2018

Your WebSocket server is probably receiving a plain HTTP request so it answers with 426:

this._server = http.createServer((req, res) => {
const body = http.STATUS_CODES[426];
res.writeHead(426, {
'Content-Length': body.length,
'Content-Type': 'text/plain'
});
res.end(body);
});

Make sure that the request is initiated by the WebSocket object in the client.

@lpinca lpinca closed this as completed Feb 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant