Socket server on different port and Client on different port

时间:2015-10-06 08:20:04

标签: angularjs node.js sockets

I am developing a private chat application. My Server side code(NodeJs + Express + Socket.io) is running on port 7000. And my client side code(AngularJs) is running on port 8000.

When I am trying to connect my socket client(running in port 8000) to socket server(which is running on port 7000), I am getting 404, which is obvious.

I have following questions related to this:-

  1. I am now unable to figure out how I can make Socket client @ port 8000 listen/get connect to socket server @ port 7000.
  2. Will there be any impact on all this configuration if tomorrow in production I will introduce Ngnix which will be running on port 80?

Thanks, Vikram

1 个答案:

答案 0 :(得分:0)

找到了解决方案。

而不是在HTML中包含socket.io: -

 

您也可以将其包含在