The page loads, but the live connection fails—or SignalR quietly switches to Long Polling.
Fastest route: First confirm that IIS has the WebSocket Protocol role service installed. Then check whether the app uses SignalR or a native ASP.NET Core WebSocket endpoint, and verify the negotiated protocol. Do not assume IIS supports HTTP/2 WebSockets just because the site serves HTTP/2.
This guide is for .NET developers deploying on IIS, Windows Server administrators checking host configuration, and teams running SignalR or Blazor Server who need to distinguish a failed WebSocket handshake from a working fallback.
This week’s action: Reproduce the issue with the affected client, record the negotiated transport, and check the IIS feature before changing application code.
Separate the visible symptom from the connection state
A page returning successfully confirms that an HTTP request reached the site. It does not prove that a real-time transport connected. SignalR may negotiate or select another transport, while a native WebSocket endpoint may fail before the application accepts the upgrade.
Start with two records from the same test attempt:
- In the browser’s developer tools, inspect the network request associated with the real-time connection. Record its URL, request protocol, status or handshake result, and any later close event.
- In the application logs, find the matching request or connection attempt. Check whether the request reached the expected endpoint and whether the app reports a WebSocket or transport error.
For SignalR, compare what the client attempted with the transport that was ultimately used. Microsoft’s SignalR configuration documentation describes transport configuration. Its diagnostics guidance helps you collect logs that can distinguish negotiation from later connection activity.
Do not treat Long Polling as proof that WebSockets work. It may keep a feature usable while masking a WebSocket-specific configuration problem. Conversely, a page that loads over HTTP or HTTP/2 does not establish that its real-time connection used the same protocol or followed the same path.
| Observation | What it tells you | Next check |
|---|---|---|
| Page loads; no real-time request appears | The page request alone did not test the transport | Confirm the client code starts the connection and inspect browser errors |
| SignalR connects using a fallback transport | SignalR is communicating, but WebSocket establishment may have failed or been unavailable | Inspect transport negotiation, IIS feature state, and diagnostics |
| Native endpoint returns an application response instead of upgrading | The request may not have reached WebSocket handling as expected | Check routing, middleware order, and endpoint logic |
| A WebSocket attempt fails only when the client uses HTTP/2 | Hosting or protocol support may be the boundary | Confirm the actual protocol and compare with the supported IIS hosting path |
Verify the IIS WebSocket Protocol role service
On the Windows Server host, open Server Manager and select Manage > Add Roles and Features. In the role services for Web Server (IIS), open Web Server > Application Development and confirm that WebSocket Protocol is selected. If you add it, complete the wizard and verify the result before retesting the application.
You can also check the Windows feature from an elevated PowerShell session when the Server Manager module is available:
Get-WindowsFeature -Name Web-WebSockets |
Select-Object Name, InstallState
If the feature is absent, install it through the Server Manager wizard or the supported server-management tools for your environment. Use the IIS WebSocket configuration reference to verify the IIS feature and configuration details. If the feature appears installed but IIS does not load the WebSocket module, follow Microsoft’s WebSocketModule troubleshooting guidance.
An installed feature is only one layer of the diagnosis. It does not prove that the application endpoint, route, authentication flow, or client protocol is correct.
After confirming the role service, repeat the same client request and compare the browser and server evidence. If the request still fails, keep the IIS feature result in your incident notes and move to the application path. Reinstalling IIS components repeatedly will not fix an endpoint that never invokes WebSocket handling.
Trace native ASP.NET Core WebSocket requests
For a native WebSocket endpoint, confirm that the app is configured to accept WebSocket requests and that the request reaches the relevant code. ASP.NET Core middleware runs in a defined order; middleware that handles or terminates a request before WebSocket handling can prevent the endpoint from receiving the expected request. Review the application’s pipeline against Microsoft’s ASP.NET Core middleware documentation.
Use this sequence to separate application behavior from host configuration:
- Confirm the client targets the exact endpoint path expected by the app. Check the deployed base path and any reverse-proxy path rewriting.
- Confirm the app enables WebSocket handling before the endpoint logic that accepts the connection.
- Check that the endpoint actually accepts WebSocket requests rather than returning a normal HTTP response.
- Review the response and application log for the handshake attempt. A failed handshake means the connection did not reach the established WebSocket state.
- Compare the same request against a known-good client or a controlled test environment, without changing several variables at once.
The ASP.NET Core WebSockets documentation for .NET 10 explains the application-side requirements and connection behavior. The WebSocket protocol specification, RFC 6455, defines the HTTP/1.1 opening handshake and the protocol’s framing. Use these references to tell a protocol-level failure from an application route or middleware issue.
If IIS reports a module problem, investigate the host. If IIS has the feature and the request reaches the application but the expected handler does not accept it, focus on routing, middleware, and endpoint behavior. Avoid treating either result as proof of the other layer’s health.
Check SignalR negotiation and fallback
SignalR is not interchangeable with a raw WebSocket endpoint. The client and server negotiate connection details, and the client may use a transport other than WebSockets when the chosen configuration and environment permit it. A successful SignalR session therefore needs to be evaluated by its negotiated transport, not just by whether the page remains interactive.
Check the transport in browser developer tools and correlate its timestamps with server-side SignalR logs. If the app is using Long Polling, confirm whether that was expected or whether WebSocket negotiation failed first. The SignalR diagnostics reference provides guidance for collecting diagnostic events; use those logs to trace the attempt rather than inferring the cause from the fallback alone.
For a clean comparison, test with the same account, browser, URL, and application build. Change one variable at a time. If an administrator disables fallback during diagnosis, do it only in a controlled test and restore the intended production policy afterward. Otherwise, you may turn a partially working feature into a complete outage without learning why the WebSocket transport failed.
Blazor Server users should apply the same distinction: a page render and a live server connection are separate states. Use the actual connection evidence and application logs to determine whether the problem is a negotiation issue, an IIS capability, or a later disconnection.
Identify the HTTP/2 boundary before changing settings
Do not infer the WebSocket protocol from the site’s general HTTPS behavior. A browser can load a page over HTTP/2 while a real-time connection uses a different protocol path. Inspect the connection request in developer tools and determine whether it is an HTTP/1.1 Upgrade request or an HTTP/2 WebSocket attempt.
For ASP.NET Core hosted behind IIS, Microsoft documents a limitation: do not assume IIS provides HTTP/2 WebSocket support. The .NET 10 WebSockets hosting guidance is the reference for the current support boundary. This does not mean IIS cannot handle WebSockets at all; it means you must verify the specific hosting and protocol combination.
Use these decision branches before editing configuration:
- If the request uses HTTP/1.1 and IIS WebSocket Protocol is missing, install the IIS role service, then retest.
- If the feature is installed and the native endpoint receives the request, inspect middleware order, routing, and the endpoint’s acceptance logic.
- If SignalR connects but uses Long Polling, inspect negotiation and diagnostics before changing fallback settings.
- If the client requires HTTP/2 WebSockets through IIS, stop treating a server feature toggle as the fix; choose a hosting path that supports the required combination.
- If the connection establishes and then closes, investigate authorization, application behavior, browser policy, and network intermediaries as a separate stage from handshake failure.
CORS is not a complete WebSocket source-protection strategy, and an
Originheader is not user authentication. Validate allowed origins where appropriate, but use the application’s authentication and authorization controls to identify and permit users.
Browser-based WebSocket requests include origin information, but non-browser clients can provide their own headers. The RFC 6455 origin model is useful for understanding the header’s role; do not treat it as proof of identity. If a connection establishes and then fails, inspect application logs and the client’s close details rather than repeatedly changing CORS settings.
Record a repeatable acceptance test
Once you have identified the likely boundary, turn the diagnosis into a deployment record. Run the test with the actual client and route used by the business application. Record the browser result, relevant server log, transport, and whether a later disconnect or reconnect behaves as expected. A repeatable record helps you distinguish a code change from an IIS or deployment change.
| Test case | Evidence to capture | Pass condition |
|---|---|---|
| SignalR connection | Negotiated transport, browser network events, matching application diagnostics | The expected transport is established, and logs show no unexplained negotiation failure |
| Native ASP.NET Core endpoint | Request protocol, endpoint route, handshake result, app log | The request reaches the intended handler and the connection is accepted |
| HTTP/2 client path | Actual protocol used and hosting arrangement | The required protocol is supported by the chosen hosting path |
| Established connection | Close event, application log, and reconnect behavior | Disconnects are visible and handled according to the application’s intended behavior |
For a deployment handoff, record the test date, application build, IIS feature state, client path, and the result for each case. Keep secrets, tokens, and personal data out of shared logs. If the test fails, preserve the evidence before applying a fix; otherwise, the next attempt may not reveal which change mattered.
For a broader server delivery record, use the dedicated server rental acceptance guide as a reference for documenting what was checked at handoff. Adapt its infrastructure checks to your application rather than treating a server acceptance record as proof that a specific WebSocket endpoint works.
Match the deployment target to the verified workload
A host change does not automatically resolve a WebSocket problem. The application pipeline, IIS role service, selected transport, and hosting protocol still need to match. Consider a dedicated Windows Server when you need a stable environment for a Windows workload or want more direct control over the server setup—not as a substitute for diagnosing a failed handshake.
AmdCli lists Windows Server 2019, 2022, and 2025 in Standard and Datacenter editions, with English, Traditional Chinese, and Simplified Chinese language options. Windows access is through RDP. The available billing periods are monthly, quarterly, semiannual, and annual; the server location is Tokyo, Japan. Check the current bare metal pricing and system options before selecting a deployment target. These options describe the server offering, not WebSocket throughput or connection capacity.
| Deployment check | AmdCli option to verify | What you still need to test |
|---|---|---|
| Windows Server release | 2019, 2022, or 2025 | Compatibility with your application dependencies and support requirements |
| Edition and language | Standard or Datacenter; English, Traditional Chinese, or Simplified Chinese | Required roles, localized administration needs, and licensing terms |
| Remote administration | RDP access | Your own account security, firewall policy, and administrative workflow |
| Billing and location | Monthly, quarterly, semiannual, or annual billing; Tokyo, Japan | Your project’s operating plan and any location-specific requirements |
Before moving a live service, confirm the target Windows Server version with the application owner, test the deployment in a controlled environment, and retain a rollback path. Recreate the WebSocket acceptance tests on the target host. If the same IIS feature, application configuration, and protocol boundary remain unchanged, a new server alone may reproduce the same failure.
Frequently asked questions
Why can the website load while its WebSocket connection fails?
The page request and the real-time connection are separate requests with different handling. A successful page response does not prove that the browser established a WebSocket. Inspect the connection request in developer tools, confirm its protocol and handshake result, and correlate it with application logs. For SignalR, identify the transport actually selected; a working fallback can conceal a WebSocket-specific problem.
Which IIS feature should you check?
Check WebSocket Protocol under the IIS Web Server role’s Application Development role services. Server Manager provides the graphical installation path, and PowerShell can report the feature state when the Server Manager module is available. After confirming it is installed, verify that IIS loads the WebSocket module and that the application route accepts the request. A role service alone does not validate application code.
What should you inspect when SignalR uses Long Polling?
First confirm the negotiated transport in the browser, then use SignalR diagnostics and application logs to locate the failed stage. Check the IIS feature and client/server transport settings before changing fallback behavior. Long Polling may keep the feature functioning, but it does not show that WebSockets succeeded. Preserve the logs and test under the same client and URL before altering production settings.
Does HTTP/2 on the website mean IIS supports HTTP/2 WebSockets?
No. A page being served over HTTP/2 does not prove the real-time connection uses HTTP/2, and IIS hosting has a documented boundary for ASP.NET Core WebSockets over HTTP/2. Inspect the actual connection protocol. If your application requires HTTP/2 WebSockets, select and validate a hosting path that supports that combination instead of assuming an IIS setting will enable it.
If your current Windows environment meets the application’s needs, fix and verify the specific IIS or application layer before moving it. If you need a dedicated Windows server for controlled deployment and ongoing operation, compare AmdCli’s listed Windows Server versions and language options against your application’s compatibility requirements, then repeat the same connection acceptance tests on the selected system.
Frequently asked questions
Why won't an ASP.NET Core WebSocket connect through IIS?
Check the IIS WebSocket Protocol role service first, then confirm that the request reaches the intended endpoint and that the application accepts WebSocket requests. Also verify the negotiated protocol: an HTTP/2 WebSocket attempt has a different hosting boundary from a standard HTTP/1.1 Upgrade request. Use browser network details and application logs to identify which stage fails before changing code or server settings.
Which IIS feature enables WebSocket connections?
The IIS role service is named WebSocket Protocol. In Server Manager, add it under Web Server (IIS), Web Server, and Application Development. Confirm installation on the server rather than assuming that a successful site deployment included the feature. If it is installed but the connection still fails, check whether the IIS WebSocket module loads and whether the application handles the endpoint.
How do I trace a SignalR connection that falls back to Long Polling?
Inspect the browser's network activity to see which transport was negotiated, then enable SignalR diagnostics and correlate those events with server logs. A page loading successfully does not prove that a WebSocket connection was established. Check the IIS feature, client and server transport settings, and any proxy or network behavior before disabling fallback; fallback can keep an app usable while also hiding a WebSocket-specific fault.
Can IIS host an HTTP/2 WebSocket connection?
Do not assume it can. Microsoft documents an IIS hosting limitation for ASP.NET Core WebSockets over HTTP/2. First confirm the protocol actually used by the client and whether the request is an HTTP/1.1 Upgrade or an HTTP/2 WebSocket attempt. If HTTP/2 WebSockets are a requirement, choose a hosting path that supports that combination rather than treating IIS as though it already provides it.
Further reading
Deploy Your .NET Workloads on Dedicated AMD Hardware
Choose an AmdCli dedicated server with Windows Server licensing for your IIS workloads.