question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't connect to server ?

See original GitHub issue

client 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:closed
  • Created 9 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
randylaymancommented, Jan 23, 2015

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.

0reactions
punkagecommented, Oct 12, 2016

@randylayman Thanks!!!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found