# C++ WebSocket connection failing

**URL:** <https://forums.unrealengine.com/t/c-websocket-connection-failing/2711061>\
**Category:** C++\
**Tags:** Networking, unreal-engine\
**Created:** [April 2, 2026, 10:06pm UTC](https://forums.unrealengine.com/t/c-websocket-connection-failing/2711061 "2026-04-02T22:06:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![VagueGamer01](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@VagueGamer01](https://forums.unrealengine.com/u/VagueGamer01)\
**Post date:** [April 2, 2026, 10:06pm UTC](https://forums.unrealengine.com/t/c-websocket-connection-failing/2711061/1 "2026-04-02T22:06:35Z")

</div>

I’m having major issues trying to get an `IWebSocket` connection to work in my C++ game (Engine version 5.7.4, source built).

I’m initialising the connection like so:

```cpp
// URL equals ws://localhost:8080/ws?token= ***&characterId=***
// WebSocketProtocol is "ws"
WebSocket = FWebSocketsModule::Get().CreateWebSocket(URL, WebSocketProtocol);
WebSocket->OnConnected().AddUObject(this, &UWolServerAuthSubsystem::HandleWebSocketConnected);
WebSocket->OnConnectionError().AddUObject(this, &UWolServerAuthSubsystem::HandleWebSocketConnectionError);
WebSocket->OnMessage().AddUObject(this, &UWolServerAuthSubsystem::HandleWebSocketMessage);
WebSocket->OnClosed().AddUObject(this, &UWolServerAuthSubsystem::HandleWebSocketClosed);
WebSocket->Connect();

```

However, I am met with only the text `Connection failed` in the error handler bound to the connection.

I don’t see any requests hitting my server for the WebSocket endpoint.

If I put in a log that prints the URL, and copy that value, I can connect perfectly fine to my server via Postman.

I’ve also tried using SSL and connecting via `wss://` (works via Postman, same failure via Unreal Engine).

At this point I’m a bit stumped. Really hoping someone else has run into this and it’s a simple fix.
