{"action":"created","issue":{"url":"https://api.github.com/repos/websockets/ws/issues/449","labels_url":"https://api.github.com/repos/websockets/ws/issues/449/labels{/name}","comments_url":"https://api.github.com/repos/websockets/ws/issues/449/comments","events_url":"https://api.github.com/repos/websockets/ws/issues/449/events","html_url":"https://github.com/websockets/ws/issues/449","id":57442664,"number":449,"title":"WebSocket connection closes immediately","user":{"login":"fredrikslattman","id":998530,"avatar_url":"https://avatars.githubusercontent.com/u/998530?v=3","gravatar_id":"","url":"https://api.github.com/users/fredrikslattman","html_url":"https://github.com/fredrikslattman","followers_url":"https://api.github.com/users/fredrikslattman/followers","following_url":"https://api.github.com/users/fredrikslattman/following{/other_user}","gists_url":"https://api.github.com/users/fredrikslattman/gists{/gist_id}","starred_url":"https://api.github.com/users/fredrikslattman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fredrikslattman/subscriptions","organizations_url":"https://api.github.com/users/fredrikslattman/orgs","repos_url":"https://api.github.com/users/fredrikslattman/repos","events_url":"https://api.github.com/users/fredrikslattman/events{/privacy}","received_events_url":"https://api.github.com/users/fredrikslattman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-12T10:31:44Z","updated_at":"2015-02-12T10:39:18Z","closed_at":null,"body":"The WebSocket client part of this library has stopped working for me. I always get the log ``` closed with code 1000 ``` when running the following code, but when I'm actually connecting to my server with the native WebSocket implementation in the browser it works fine. My server doesn't even get the request, so it seems to be in the WebSocket connection layer.\r\n\r\nCan this issue be related to a upgradeReq.url in combination with a sub protocol?\r\n\r\nExample\r\n----\r\n``` javascript\r\nvar WebSocket = require('ws');\r\nvar ws = new WebSocket('ws://localhost:3001/?client=MTI3&tag=8f261', 'protocol.example.com');\r\n\r\nws.on('open', function open() {\r\n  ws.send('something');\r\n});\r\n\r\nws.on('close', function (code) {\r\n  console.log('closed with code', code);\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/websockets/ws/issues/comments/74050326","html_url":"https://github.com/websockets/ws/issues/449#issuecomment-74050326","issue_url":"https://api.github.com/repos/websockets/ws/issues/449","id":74050326,"user":{"login":"fredrikslattman","id":998530,"avatar_url":"https://avatars.githubusercontent.com/u/998530?v=3","gravatar_id":"","url":"https://api.github.com/users/fredrikslattman","html_url":"https://github.com/fredrikslattman","followers_url":"https://api.github.com/users/fredrikslattman/followers","following_url":"https://api.github.com/users/fredrikslattman/following{/other_user}","gists_url":"https://api.github.com/users/fredrikslattman/gists{/gist_id}","starred_url":"https://api.github.com/users/fredrikslattman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fredrikslattman/subscriptions","organizations_url":"https://api.github.com/users/fredrikslattman/orgs","repos_url":"https://api.github.com/users/fredrikslattman/repos","events_url":"https://api.github.com/users/fredrikslattman/events{/privacy}","received_events_url":"https://api.github.com/users/fredrikslattman/received_events","type":"User","site_admin":false},"created_at":"2015-02-12T10:39:18Z","updated_at":"2015-02-12T10:39:18Z","body":"I'm aware of this, I'll update the issue with the server implementation. It's not related to the sub protocol."}}