How Can I open websocket port on azure?

一笑奈何 提交于 2019-12-14 03:13:51

问题


I want to create live chatroom by BrainSocket.I follow from this tutorial ,and it's work well on my localhost.When i deploy on ubuntu 14.04 on azure virtual machine it not work. Chrome Inspect is tell me error on this part of my code

 app.BrainSocket = new BrainSocket(
                    new WebSocket('ws://myappname.cloudapp.net:8080'),
                    new BrainSocketPubSub()
            );

it's tell ws://myappname.cloudapp.net:8080 is return 404 not found... I guess it should be web socket port problem on Azure. How can I open web socket port 8080 on Azure virtual machine ?


回答1:


You have to add an Endpoint to your virutal machine. Go to Management Portal/Your_VM/Endpoints and click add new. Your endpoint configuration should look similar to this:

Detailed instruction can be found here http://azure.microsoft.com/en-gb/documentation/articles/virtual-machines-set-up-endpoints/



来源:https://stackoverflow.com/questions/26872643/how-can-i-open-websocket-port-on-azure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!