Uncaught TypeError: cannot call 'onClose' method from null

I am working on a node.js chat application, I hosted node.js in IIS on Windows. my intention is to enable node.js in asp.net mvc, as explained by Jon Galloway for chatting (text, audio, video) on an asp.net network application.

my Installation Details:
iisnode.js - iisnode-full-iis7-v0.2.3-x86
node.js - node -v0.8.19-x86
version of express.js - 3.1.0
socket.io version is 0.9.13
on Windows 7 32-bit system with IIS 8.0 support

I successfully hosted node.js in IIS and ran samples

But when I run coading socket.io, I am stuck ..

when I start connecting with the client browser to the server, I got an error in the client browser saying
Uncaught TypeError: Cannot call 'onClose' method from null socket.io.js: 1771

On my iam server using socket.io configuration like

io.configure(function () { io.set('transports', [ 'xhr-polling' , 'jsonp-polling' ]); io.set("polling duration", 10); if (process.env.IISNODE_VERSION) { io.set('resource', 'node/socket.io'); } }); 

Is this a problem with iam versions using (express, and socket.io node.js). Or in my cooding any idea about a problem, please help me.

thanks.

+6
source share
1 answer

I think this is because you did not specify the resource path in the client.io configuration. client.

 socket = io.connect('http://myurl/node/socket.io', { resource : 'node/socket.io' }) 
+7
source

All Articles