pgte / nodetuts_26

Node Tuts episode 26
17 stars 2 forks source link

Can we create socket instance by using socket = new io.Socket #1

Open buzzshiva opened 13 years ago

buzzshiva commented 13 years ago

Can you let me know why case 1 doesn't work but case 2 works.

You code for chat using socket.io : https://gist.github.com/671318

Case 1: var socket = new io.Socket('localhost', {port: 4000}); socket.connect();

Case 2: var socket = io.connect("http://localhost:4000/");