Azure node.js/socket.io with websocket transport

193 views
Skip to first unread message

alex

unread,
Feb 11, 2012, 3:00:51 AM2/11/12
to nod...@googlegroups.com
Hi guys,

I was wondering if anyone has tried to deploy node with socket.io to azure? What are your experiences? I have a sample app deployed but it falls back to xhr-polling despite a MS rep claiming that websocket transports should work out of the box: http://social.msdn.microsoft.com/Forums/en-US/windowsazureconnectivity/thread/74308a54-e06b-479d-af7f-7ad0fef498e1

Thanks for any pointers ;)

Cheers,
Alex

Glenn Block

unread,
Feb 11, 2012, 12:47:02 PM2/11/12
to alex, nod...@googlegroups.com
That person is me. I work on the team that builds the sdk. It definitely works in worker role.

Can you show me the code that you are using in your server.js to wire up socket.io?

Sent from my Windows Phone

From: alex
Sent: 2/11/2012 4:55 AM
To: nod...@googlegroups.com
Subject: [nodejs] Azure node.js/socket.io with websocket transport

--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Glenn Block

unread,
Feb 11, 2012, 2:09:34 PM2/11/12
to nod...@googlegroups.com
Alex, I am looking into this and will get back to you. 

Alex

--

Angel Java Lopez

unread,
Feb 11, 2012, 2:55:03 PM2/11/12
to nod...@googlegroups.com
There is an example with worker role + socket.io, that uses websocket:

by @marianodvazquez

but web role runs on IIS7, that doesn't support websocket, yet. I didn't try the example on Azure.


Angel "Java" Lopez


--

Glenn Block

unread,
Feb 11, 2012, 3:49:54 PM2/11/12
to Angel Java Lopez, nod...@googlegroups.com
Yes, the problem appears to be however that it is still falling back to xhr polling in worker. You can see that by opening the dev toolbar in Chrome and viewing the network traffic. I am pretty sure this was working earlier. If not, we will make it work :-)


Sent from my Windows Phone

From: Angel Java Lopez
Sent: 2/11/2012 11:55 AM
To: nod...@googlegroups.com
Subject: Re: [nodejs] Azure node.js/socket.io with websocket transport

Glenn Block

unread,
Feb 12, 2012, 3:11:53 AM2/12/12
to Angel Java Lopez, nod...@googlegroups.com
It looks like it is working all.

If you head to http://gblock-chat.cloudapp.net, I have fixed it to use just WebSockets. Chrome is able to connect fine. I have also tested with using the default set of transports and it does not degrade to xhr.

Angel, can you try it out?

Thanks
Glenn

Glenn Block

unread,
Feb 12, 2012, 3:48:43 AM2/12/12
to nod...@googlegroups.com
Here's a screenshot in Fiddler showing the WebSockets traffic working in the sample app I have running on worker role on Azure.

--

alex

unread,
Feb 13, 2012, 1:16:33 AM2/13/12
to nod...@googlegroups.com
After some digging, many Azure deployments and generally a lot of time spent it turns out that the internet provider blocked websocket connections on port 80 and 8080 (secured websockets worked though). I have just tested my app through my own network setup and provider and it appears to work fine from there. For me the takeout is that a solution like socket.io that can fallback to more conventional HTTP based connections is very valuable in that it helps to circumvent these sorts of issues.

Thanks to Glenn who helped me along the way by suggesting solutions, testing and eliminating other possible issues!
Reply all
Reply to author
Forward
0 new messages