Can't connect to server ?
See original GitHub issueclient error
WebSocket connection to 'ws://10.150.140.68:3888/socket.io/?EIO=2&transport=websocket' failed: Connection closed before receiving a handshake response socket.io-1.0.0-pre5.js:2
Resource interpreted as Image but transferred with MIME type text/html: "http://pingtcss.qq.com/pingd?dm=10.150.140.68:3887&pvi=8765514752&si=s63491…x768&scl=24-bit&lg=en-us&jv=1&tz=-8&ct=&ext=adid=&pf=&random=1401368717118". stats?sId=23713003:18
3
WebSocket connection to 'ws://10.150.140.68:3888/socket.io/?EIO=2&transport=websocket' failed: Connection closed before receiving a handshake response
client code
function connect (callback) {
var socket = io("ws://10.150.140.68:3888", {transports: ['websocket',]});
socket.on('connect', callback)
}
server code
var app = express.createServer()
var io = require("socket.io").listen(3888, {origins: '*:*'})
io.server.removeListener('request', io.server.listeners('request')[0]);
io.sockets.on('connection', function(){
console.log('connection');
})
server error
* started http://0.0.0.0:3887/
warn - unknown transport: "undefined"
warn - unknown transport: "undefined"
warn - unknown transport: "undefined"
warn - unknown transport: "undefined"
warn - unknown transport: "undefined"
warn - unknown transport: "undefined"
warn - unknown transport: "undefined"
warn - unknown transport: "undefined"
warn - unknown transport: "undefined"
warn - unknown transport: "undefined"
warn - unknown transport: "undefined"
Issue Analytics
- State:
- Created 9 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
What does "Can't Connect to Server" mean, and how to fix it?
Some software may have an issue with it, and when it requests a resource from the server, due to a software error, it...
Read more >5 Ways to Fix Unable To Connect To Server
5 Ways to Fix Unable To Connect To Server · 1. Check Internet Connection · 2. Restart Device · 3. Check Date &...
Read more >"Cannot connect the computer to the server" error message ...
Cannot connect the computer to the server because either another software installation is in progress or, the computer has a restart pending.
Read more >Effective Ways To Fix "Couldn't Open Connection To Server"
Step 1: Restarting your Device · Step 2: Check if the Network Connection is working fine · Step 3: Is your SIM okay?...
Read more >Cannot Connect to Server: How to Connect to Company Server
What To Do When You Cannot Connect To The Company Server · 1. Restart Your Computer · 2. Follow the Error Messages ·...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For anyone who comes across this via Google, this error message can be caused by having different versions of socket.io-client and socket.io. In my case client was version 1.3.6 and server was 0.9. Downgrading the client to 0.9 made the error go away and allowed me to connect successfully.
@randylayman Thanks!!!