如何在Azure上打开websocket端口

如何在Azure上打开websocket端口

本文介绍了如何在Azure上打开websocket端口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过 BrainSocket 创建实时聊天室.我从本教程,它在我的本地主机上运行良好.蔚蓝虚拟机上的ubuntu 14.04无法正常工作.Chrome检查器告诉我这部分代码

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()
            );

告诉ws://myappname.cloudapp.net:8080返回404找不到...我猜应该是Azure上的Web套接字端口问题.如何在Azure虚拟机上打开Web套接字端口8080?

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 ?

推荐答案

您必须在虚拟机上添加一个端点.转到管理门户/Your_VM/端点,然后单击添加新的.您的端点配置应类似于以下内容:

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:

可在此处找到详细说明 http://azure.microsoft.com/zh-CN/documentation/articles/virtual-machines-set-up-endpoints/

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

这篇关于如何在Azure上打开websocket端口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-16 04:54