Using both port 443 and websockets proxies in conjunction with IIS web server simultaneously

Despite my extensive research on websockets and reverse proxies, I have yet to find a satisfactory solution or answer.

  1. I am interested in using websockets alongside my webserver on the same port (80 or 443). Is it possible to make this work with IIS? I am aware of changes made after IIS 8, but what about previous versions, and how can I configure it in IIS 8?

  2. Each server I set up may have a different URL or be accessed through a proxy. Can I configure my javascript client to always connect to the websocket server no matter what? I know I could try something like:

    var url = ws://" + window.location.hostname + ":12345";

But will this approach still work if there is a proxy involved?

Thank you!

Answer №1

Prior to version 8, IIS does not support WebSockets. In order to utilize websockets, hosting them in a separate process on a different port is necessary.

With IIS8, websockets can operate on the same ports as your web application. You can create various websocket endpoints within the same ASP.NET application, such as one for /sports/soccer and another for /sports/golf to receive updates specific to each sport with distinct handlers if desired.

For information on proxies, refer to How HTML5 Web Sockets Interact With Proxy Servers. In general, using WSS:// should work smoothly most of the time.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Express - Unhandled promise rejection detected

I am working with two tables, one for graduates and another for mentors. My goal is to determine which table an email belongs to by using the provided endpoint. router.post("/reset/:email", async (req, res) => { //searching for the table from ...

The nested router fails to provide the next callback containing the value of 'route'

While developing a middleware handler, I ran into an interesting issue where passing the route string as an argument for the next callback resulted in a value of null. Here's an example to illustrate this: var express = require('express') ...

Having difficulty applying parseFloat directly following a JSON Stringify operation

There's a specific line of code I'm working with that reads -- let longitude = JSON.stringify(place.lon); After calling alert(longitude), I receive the output "44.54321". However, my intention is to retrieve just the number itself, so I attempt ...

Tips for launching multiple windows with the click of a button

Within my design, I have incorporated a total of three buttons. My goal is to have each button trigger the opening of a new window. I have successfully implemented the functionality to open a new window. However, upon clicking on the second button, it open ...

Does data bind only when it is displayed in the textbox?

I am experiencing an issue with a gridview that contains an invisible TextBox control, which is data-bound on a click event. When another click event sets the visibility to true, the TextBox becomes empty. Instead of rebinding the gridview, I would like to ...

What is the correct way to remove listeners in componentWillUnmount using React, and why is binding necessary in the constructor?

I'm feeling a bit perplexed, can someone explain the distinction between these two snippets of code: constructor(props) { super(props); this.state = { openPane: false } this.togglePaneHelper = this.togglePaneHelper.bind(this); ...

When the user clicks, reveal the form with a seamless transition

Check out my jsfiddle here: http://jsfiddle.net/tz52u/9/ I'm curious about how to create a smooth transition for the 'on click' event, so that it gradually appears on the page instead of appearing instantly? Any assistance would be greatl ...

Leveraging JQuery for activating an event with Bootstrap Scrollspy

I'm facing a challenge in capturing the Scrollspy event to execute a specific function. The Scrollspy feature is functioning correctly in terms of updating the active link on the navbar. However, I am struggling to capture the event for use in other p ...

Reviewing file information prior to submission

Is there a way or method we can utilize to validate file details (extension and size) before the form is submitted by the user? I have limited knowledge of jQuery or JavaScript, so please provide detailed assistance if that is the solution. I envision tha ...

Retrieving data from a string and storing it in a database

I am working with multiple columns represented by <ul> elements that can be sorted using jQuery UI. In order to save the positions of the <li> items within these <ul> elements, I need to serialize the data. $(function() { $("ul.sortable ...

Tips for managing input for objects in Vue when the object hasn't been declared yet?

<input type="text" v-model="object[obj]"> Output: object:{'obj1':value} Desired outcome after input is added: object:{'obj1':{'prop1':value,'prop2':value}} <input type="text" ...

Guiding users who have disabled JavaScript through redirection

When faced with the following markup, users whose browser has JavaScript disabled will be redirected to an alternative page. This alternate page may attempt to mimic the site's functionality without JavaScript or simply display a warning message infor ...

Redirect the Submit button to the specified URL from the form element

Looking for a way to create a form with two fields: Username and Password. Upon clicking submit, the username and password should be added to the URL in a specific format. For instance: The URL structure will remain the same, only the "username_entered_i ...

AngularJS directive for attributes. Steps for adding a second attribute directive during compilation phase

I am interested in creating an attribute directive that adds an icon to a button when it is disabled. Click here to see a similar example on Fiddle In addition, I would like to include the ng-disabled directive during the compile process (with the value ...

ASP.NET Details View: Dynamic Dropdown List Interaction

I am facing an issue with two dropdown lists within a detailsview: one for College and the other for Department. The requirement is that when a user selects a college, the department dropdown list should populate with all departments related to the selecte ...

Is there a way to change the entire background color of my popover?

Hi there! My issue is that the arrow in my popover isn't changing color and is still showing up as white. Here is the current code: http://jsfiddle.net/GZSH6/19/ Here is the CSS code: .popover { background: #BE7979; color: white; borde ...

a method for inserting a space after a certain character, with the exception of when that character is located at the start or end of a line

I've created a regular expression that can modify various patterns like: anything1 * anything2* anything3 anything1* anything2 * anything3 anything1 * anything2 * anything3 anything1*anything2 *anything3 anything1 * anything2 *anything3 anything1*any ...

jQuery: Maintain hover state regardless of browser's suggestions for input elements

I have a navigation with a nested ul list structure like this <ul id='mainNav'> <li> Some Stuff! <ul> <li>Page 1</li> <li>Page 2</li> </ul> </li> <li> Hover here t ...

Organize a collection of objects (with X and Y attributes) to ensure they are arranged from left to right and top to bottom

In the array, each item is placed on the stage with an x/y position. The top left most position should be items[0], with X as the primary positioning factor. Initially, I considered using the following code: var items = [m1, m2, m3, m4, m5, m6]; items.s ...

Access to property 'CKEDITOR' is unauthorized

After successfully integrating CKEditor and CKFinder on multiple sites, I encountered an issue with one particular site. Upon inspecting the Firebug console, I noticed the following error message: Error: Permission denied to access property 'CKEDITOR ...