'How to open websocket for Azure Windows VM

I have added 9094 to the endpoint and trying to access xxx.cloudapp.net:9094/socktio.... But I am still not able to hit this with the client deployed on my lapton. I keep getting connection timedout error, although the server starts properly without error. I am using java language and run this program as a standalone java application

[main] INFO com.corundumstudio.socketio.SocketIOServer - Session store /     pubsub factory used: MemoryStoreFactory (local session store only)
[nioEventLoopGroup-2-1] INFO com.corundumstudio.socketio.SocketIOServer - SocketIO server started at port: 9094

Just tagging these questions which doesnot solve the problem yet How Can I open websocket port on azure?



Solution 1:[1]

Per my experience, this issue may be due to the wrong firewall config. You could create a NSG which controls both inbound and outbound traffic of your VM.

The following steps may be useful for you.

1.You could create a Network Security Group.

1)Select the resource group where the VM resides, then click the Add button. enter image description here

2)To search the Network security group in the search bar. enter image description here

3)Input some parameters to create a new NSG. enter image description here

2.You could add an inbound security rule in the NSG.

1)Select the Network security group which you have created and click the Add button. enter image description here

2)input some parameters to create a new inbound security rule. enter image description here

3.You could associate your Network Security Group with a subnet or a specific network interface. 1)Select the NSG which you have created and click the Associate button. enter image description here

2)Select your virtual network and then select the appropriate subnet. enter image description here

The reference: https://azure.microsoft.com/en-gb/documentation/articles/virtual-machines-windows-nsg-quickstart-portal/

Hope it helps. Any concerns, please feel free to let me know.

Solution 2:[2]

There were couple of issues i had. one was obviously was resolved by @johnny above. I am sure that made some difference. second issue was the way i started the server on Azure windows vm. Instead of starting it as 0.0.0.0 9094 i was trying to start as 127.0.0.1 or localhost. This resolved the issue I had with socket server running on windows azure vm.

Solution 3:[3]

Per my experience

  1. Open port 9094 Inbound security rule on Machine-nsg on Azure
  2. Open port 9094 on VM firewall inbound rule

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 johnny
Solution 2 Prasanna Bableshwar
Solution 3 DharmanBot