Before starting an ASP.NET Core SignalR client, configure its connection options:

var connection = new HubConnectionBuilder()
    .WithUrl("https://events.example/hub", options =>
    {
        options.Proxy = new WebProxy("http://proxy.example:8080");
    })
    .Build();

This fragment uses the modern SignalR client and System.Net. Manage connection through the application's async lifecycle; keep the hub URL as the destination. For a permitted public hub test with no proxy credentials configured, the HTTP proxy list supplies candidate HTTP intermediaries.

Transport setupWhere the proxy applies
Default connection behaviorHttpConnectionOptions.Proxy selects the intermediary; .NET 8's default WebSocket transport also assigns it to ClientWebSocketOptions
HttpMessageHandlerFactoryCustomizes HTTP handling, not WebSocket connections
A supplied WebSocketFactoryOwns its creation behavior and must apply its required route

A successful negotiation does not prove the later WebSocket tunnel was accepted. If a custom WebSocketFactory uses .NET ClientWebSocket, configure that socket’s proxy before connecting. Read transport diagnostics for the last completed step and inspect any deliberate fallback transport too.

Older ASP.NET SignalR examples setting Connection.Proxy belong to another generation. With HubConnectionBuilder, keep the proxy with the other WithUrl transport options rather than configuring an unrelated HTTP request.

ХӀокхунах тера йаззамаш