Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7496299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T18:33:32+00:00 2026-05-29T18:33:32+00:00

I would like to run a WebSocket server off a worker role in Azure.

  • 0

I would like to run a WebSocket server off a worker role in Azure.

This works fine locally on the emulator, but there is a windows firewall prompt the first time the socket server runs.

I’m wondering if anyone would know how to overcome the connection issues with regards to sockets on Azure.

My socket server implementation: OnStart

var server = new WebSocketServer("ws://theappname.cloudapp.net:8080/");

server.Start(socket =>
{
    socket.OnOpen = () =>
    {
        Trace.WriteLine("Connected to " + socket.ConnectionInfo.ClientIpAddress,"Information");
         _sockets.Add(socket);
    };
});
.... etc

The client implementation:

var socket = new WebSocket("ws://theappname.cloudapp.net:8080");

socket.onopen = function () {
    status.html("Connection Opened");
};
socket.onclose = function () {
    status.html("Connection Closed");
}

The status changes to closed a few seconds after loading the page.


My endpoint for the worker role below:

WebSocket Input http 8080 <Not Set>


I have now tried to bind to the internal IP address using the following:

RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["WebSocket"].IPEndpoint.ToString();


SOLUTION

For the sake of anyone else facing this when implementing websockets on Azure;

  1. Your firewall probably will deny your connection if not on port 80 or 8080 so create a separate deployment for it.

  2. Endpoint must be set to TCP and not HTTP for the correct firewall rules to be created. (see image)

Endpoint Configuration

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T18:33:35+00:00Added an answer on May 29, 2026 at 6:33 pm

    Just for the sake of trial, why don’t you change your Input Endpoit from “http” to “tcp” protocol. And explicitly set the local port to 8080 (which in your case is ). Also you have to keep in mind that Windows Azure Load Balancer would kill any connection that is idleing for more than 60 seconds, so you might want to implement some kind of “ping” solution to keep the connection open.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to run APIDemos under platforms\android-1.5\samples directory on Android emulator but I
I would like to run git reset *.foo but this errors out. I think
I would like to run Windows Server AppFabric Caching locally on a Windows 7
I wrote a simple EventMachine server like this one: EventMachine.run do EventMachine::WebSocket.start(:host => HOST,
I would like to run a Java program with garbage collection switched off. Managing
I would like to run a query on my database like this: SELECT SUM(
I would like to run PHPUnit tests on the development server as opposed to
I would like to run a Dos program from a web server. The Dos
I would like to run my own internal PyPI server, for egg distribution within
I would like to run a Django project on a server using virtualenv in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.