1

I'm writing a Node.js service with SocketIO and offer multiple services via that Node.js service. Originally, I used additional path for such task, for example,

example.com/api <- routes
example.com/livechat <- SocketIO

However, the service is being moved to a virtual host with subdirectory. So instead of 'example.com' as root, I get 'example.com/nodejs/'. Problem is, socketIO still thinks it's reaching out to 'example.com', so all socket request end up in 404.

Angela
  • 1,064
  • 1
  • 11
  • 23
  • This stackoverflow answer may help: http://stackoverflow.com/questions/25896225/how-do-i-get-socket-io-running-for-a-subdirectory – Drew LeSueur Sep 17 '14 at 17:38

1 Answers1

0

you need to use the resource option which is defined in Configuring-Socket.IO

This option should be set on the client and on the server

leszek.hanusz
  • 5,152
  • 2
  • 38
  • 56