Skip to content

[hot-refresh] WebSocket connection to 'ws://localhost:50417/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED #61646

Open
@s97712

Description

@s97712

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

During remote access, the browser reports the following error:

WebSocket connection to 'ws://localhost:50417/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

After investigating, we discovered that in aspnetcore-browser-refresh.js the host is hard-coded to localhost, so it never attempts to connect back to the remote machine.

const webSocketUrls = 'wss://localhost:50416,ws://localhost:50417'.split(',');

Expected Behavior

No response

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions