SocketGate
Realtime client for Amazon API Gateway WebSocket APIs in Blueprints and C++: IAM (SigV4) or token authorization, auto-reconnect, keep-alive, request/reply and server-sidβ¦
Highlights
All 12 features βSocketGate connects your game to Amazon API Gateway WebSocket APIs, a serverless way to push data to players in real time. Use it for chat, lobbies, live events, notifications, turn-based play and anything else your backend sends to players.
Create Socket Connection gives you a connection object with On Connected, On Message, On Closed, On Error and On Reconnecting events. Send Text sends raw frames. Send Json Action sends {"action": route, ...} messages, which API Gateway routes with its default route selection expression. The socket uses the engine's own WebSocket client, and every event arrives on the game thread.
The $connect route can be protected three ways. In IAM mode SocketGate presigns the URL with AWS Signature Version 4, using temporary credentials from an Amazon Cognito identity pool for guest or signed-in players. Signing happens on a background thread, and every connection attempt gets a fresh URL. In Token mode it sends a Cognito user pool ID token or any other token to your Lambda authorizer, as a header or a query parameter. Open APIs need no authorization. Extra headers and query parameters reach your $connect integration in all modes.
Connections take care of themselves. They reconnect after drops with exponential back-off and jitter. They send a keep-alive message before API Gateway's 10-minute idle timeout, and come back after its 2-hour connection limit. They stay alive without a variable holding them, and close by themselves when the game instance shuts down, including at the end of Play In Editor.
Send And Wait For Reply turns the socket into request/response: it adds a requestId to the message and completes when your backend echoes it, or times out.
Dedicated servers and tools with IAM credentials can manage clients directly. Post To Connection pushes data to one player, Get Connection reads connection details, and Delete Connection disconnects a client.
SocketGate is part of the Alpha XP AWS collection for Unreal Engine 4.27 and 5.8. It includes the AWS SDK for C++ prebuilt for Win64, Linux and Android and ships with styled HTML documentation, including example IAM policies.
Key features
- Socket connection object with On Connected, On Message, On Closed, On Error and On
- Send Text and Send Json Action ({"action": route, ...} for $request.body.action routing)
- $connect authorization: None, IAM (presigned SigV4 URL) or Token (header or query
- Extra headers, query parameters and WebSocket subprotocols
- Auto-reconnect with exponential back-off and jitter; a fresh signed URL for every attempt
- Keep-alive message against API Gateway's 10-minute idle timeout
- Send And Wait For Reply: request/response matched by a generated requestId, with timeout
- Server side: Post To Connection, Get Connection, Delete Connection
- Amazon Cognito identity pools for guest and signed-in players; static keys and the
- Active connections are kept alive and closed automatically when the game instance
- Struct To JSON, JSON To Struct and Get JSON Field helpers
- Project Settings page for every default
Blueprint & C++ API
Every call is reachable from more than one place β pick the entry point that fits your project:
| Class | Type | Nodes | Use it for |
|---|---|---|---|
| SocketGateLibrary | Function library | 13 | Connections, configuration, identity and JSON helpers for SocketGate. |
| SocketGateConnection | Object | 6 | One realtime connection to an Amazon API Gateway WebSocket API. Create it with Create Socket Connection, bind its events, then call Connect. |
| Async action nodes | Latent Blueprint nodes | 2 | Latent node with success / failure output pins. |
Callable runs when executed Β· Pure no exec pin, returns a value Β· LatentAsync finishes later and fires its outputs
SocketGate 10
| Node | Type | Available on | Description |
|---|---|---|---|
| Cancel | Async | Async | Stops waiting: none of this node's output pins fire any more. A request already sent may still complete on AWS. |
| Is Finished | Async | Async | True after Cancel was called or the node finished. |
| Connect() β Boolean | Callable | Object | Opens the connection (signing the URL first in IAM mode). Returns false if it is already active or the URL is not ws:// / wss://. |
| Close(Status Code: Integer, Reason: String) | Callable | Object | Closes the connection and stops reconnecting. Status Code 1000 (normal) or 3000-4999. |
| Send Text(Text: String) β Boolean | Callable | Object | Sends a text frame. Returns false when not connected or larger than API Gateway's 128 KB message limit. |
| Send Json Action(Route: String, Payload Json: String) β Boolean | Callable | Object | Sends {"action": Route, ...fields of Payload Json} - the shape API Gateway routes with $request.body.action. Payload Json must be a JSON object or empty. |
| Is Connected() β Boolean | Pure | Object | True while the socket is open. |
| Get State() β Socket Gate State | Pure | Object | Not Connected, Connecting, Connected, Reconnecting or Closing. |
| Create Socket Connection(Url: String) β Socket Gate Connection | Callable | Static | Creates a WebSocket connection with the options from Project Settings > Plugins > SocketGate. |
| Make WebSocket Url(Api Id: String, Region: String, Stage: String) β String | Pure | Static | Builds wss://<api-id>.execute-api.<region>.amazonaws.com/<stage>. Empty Region = the configured region. |
Config 3
| Node | Type | Available on | Description |
|---|---|---|---|
| Set Region(Region: String) | Callable | Static | Switches the AWS region used by every following request. |
| Set Credential Mode(Mode: Socket Gate Credential Mode) | Callable | Static | Overrides the credential mode from the project settings at runtime. |
| Is Configured() β Boolean, Problem | Pure | Static | Checks the credential settings (needed for IAM mode and the management nodes) and returns false with a reason when they are incomplete. |
Identity 5
| Node | Type | Available on | Description |
|---|---|---|---|
| Set Login Token(Provider: String, Token: String) | Callable | Static | Signs the player in to the Cognito identity pool with a token from an identity provider. |
| Clear Login Tokens | Callable | Static | Forgets all login tokens and the cached identity (the player becomes a guest again). |
| Set Static Credentials(Access Key Id: String, Secret Access Key: String, Session Token: String) | Callable | Static | Uses these credentials from now on (Static Keys mode), for example temporary keys handed out by your own backend. |
| Get Identity Id() β String | Pure | Static | The Cognito identity id of this player, empty until credentials were resolved once. |
| Make User Pool Provider Name(Region: String, User Pool Id: String) β String | Pure | Static | Builds the identity-pool login key of a Cognito user pool: cognito-idp.<region>.amazonaws.com/<user pool id>. |
JSON 3
| Node | Type | Available on | Description |
|---|---|---|---|
| Struct To JSON(Struct: Integer) β Boolean, Json | Callable | Static | Converts any struct to a JSON object string (property names are used as keys). |
| JSON To Struct(Json: String) β Boolean, Out Struct | Callable | Static | Fills a struct from a JSON object string; fields that are missing keep their default values. |
| Get Json Field(Json: String, Path: String) β Boolean, Value | Pure | Static | Reads one value from a JSON document with a path such as "player.stats[2].score". Strings are returned as-is, numbers and booleans as text, objects and arrays as JSON. |
Events & delegates
Bind these in Blueprint (drag off the object β Bind Event) or with AddDynamic in C++.
| Event | Parameters | Fires on | When it fires |
|---|---|---|---|
| On Reply | Reply (String), Error (Socket Gate Error) | SocketGateReplyAction | The reply arrived (the whole message text). |
| On Timeout | Reply (String), Error (Socket Gate Error) | SocketGateReplyAction | No reply within the timeout (Error.Code = "Timeout"). |
| On Failure | Reply (String), Error (Socket Gate Error) | SocketGateReplyAction | Not connected, the message could not be sent, or the connection closed while waiting. |
| On Success | Info (Socket Gate Connection Info), Error (Socket Gate Error) | SocketGateManageAction | |
| On Connected | β | SocketGateConnection | The connection is open. Also fires after every successful reconnect. |
| On Message | Message (String) | SocketGateConnection | A text message arrived (replies of Send And Wait For Reply arrive here too). |
| On Closed | Status Code (Integer), Reason (String), Was Clean (Boolean) | SocketGateConnection | The connection closed or dropped. If Get State says Reconnecting, a new attempt is already scheduled. |
| On Error | Error (Socket Gate Error) | SocketGateConnection | A connection attempt failed (handshake, signing, token, timeout) or reconnecting gave up ("ReconnectFailed"). |
| On Reconnecting | Attempt (Integer), Delay Seconds (Float) | SocketGateConnection | A reconnect attempt was scheduled after DelaySeconds. |
Project settings
Configure once under Project Settings βΊ Plugins βΊ SocketGate β values are saved to the project's config .ini, so they travel with the project and your build.
| Setting | Section | Type | What it does |
|---|---|---|---|
| Region | Connection | String | AWS region of your WebSocket API and identity pool, for example "us-east-1". URLs on execute-api.<region>.amazonaws.com sign with their own region. |
| Request Timeout Ms | Connection | Integer | Time an AWS request (credentials, management calls) may take, in milliseconds. |
| Connect Timeout Ms | Connection | Integer | Time allowed to open an AWS HTTPS connection, in milliseconds. |
| Max Retries | Connection | Integer | Automatic retries with exponential back-off for throttled and transient AWS failures. |
| Worker Threads | Connection | Integer | Worker threads that sign URLs and run management calls in the background (they never block the game thread). |
| Verify SSL | Connection | Boolean | Verify TLS certificates of AWS requests. Only disable for a local test endpoint. |
| Log Sdk Warnings | Connection | Boolean | Forward SDK warnings and errors to the Output Log (LogSocketGate). |
| Credential Mode | Credentials | Credential Mode | Where AWS credentials come from (IAM mode and the management nodes). |
| Identity Pool Id | Credentials | String | Cognito identity pool, for example "us-east-1:01234567-89ab-cdef-0123-456789abcdef". |
| Allow Guest Access | Credentials | Boolean | Allow unauthenticated (guest) identities before Set Login Token is called. The pool must allow guest access too. |
| Access Key Id | Credentials | String | Access key for Static Keys mode. Keys saved here end up in DefaultGame.ini - use them for development and servers only. |
| Secret Access Key | Credentials | String | Secret key for Static Keys mode. |
| Allow Static Keys In Shipping | Credentials | Boolean | Static keys are refused in Shipping builds unless this is enabled (for example on a dedicated server). |
| Default Web Socket Url | WebSocket | String | URL used when Create Socket Connection gets an empty URL, for example "wss://abc123.execute-api.us-east-1.amazonaws.com/production". |
| Auth Mode | WebSocket | Auth Mode | How new connections authorize the $connect route. |
| Token Location | WebSocket | Token Location | Token mode: send the token as a header or as a query parameter. |
| Token Header Name | WebSocket | String | Token mode: header that carries the token (the authorizer's identity source, for example route.request.header.Authorization). |
| Token Query Name | WebSocket | String | Token mode: query parameter that carries the token (identity source route.request.querystring.<name>). |
| Presign Expiry Seconds | WebSocket | Integer | IAM mode: how long a presigned URL stays valid, in seconds. A new URL is signed for every connection attempt. |
| Route Field | WebSocket | String | Field that carries the route in Send Json Action. Matches the API's route selection expression $request.body.action. |
| Socket Connect Timeout Seconds | WebSocket | Float | Time allowed for the WebSocket handshake, in seconds. |
| Auto Reconnect | Reconnect | Boolean | Reconnect automatically after network errors and connections dropped by the server (a fresh URL is signed every time). |
| Max Reconnect Attempts | Reconnect | Integer | Attempts in a row before giving up; 0 = never give up. |
| Reconnect Base Delay Seconds | Reconnect | Float | Delay before the first attempt, in seconds; it doubles with every failed attempt (plus or minus 20% jitter). |
| Reconnect Max Delay Seconds | Reconnect | Float | Upper limit of the back-off delay, in seconds. |
| Keep Alive Interval Seconds | Keep Alive | Float | Sends Keep Alive Message when the client sent nothing for this many seconds; 0 = off. API Gateway closes idle connections after 10 minutes. |
| Keep Alive Message | Keep Alive | String | Text sent as keep-alive. Route it to a cheap route (for example a mock integration on "ping") or $default. |
| Request Id Field | Replies | String | Field that Send And Wait For Reply adds to the message and expects back in the reply. |
| Default Reply Timeout Seconds | Replies | Float | Time Send And Wait For Reply waits when its Timeout pin is 0, in seconds. |
| Default Management Endpoint | Management | String | Connection management endpoint used when a node leaves Endpoint empty: https://<api-id>.execute-api.<region>.amazonaws.com/<stage>. |
Options & enums
| Enum | Values |
|---|---|
| Credential Mode | Cognito Identity Pool Static Keys Default Credential Chain |
| Auth Mode | None IAM (SigV4) Token |
| Token Location | Header Query Parameter |
| State | Not Connected Connecting Connected Reconnecting Closing |
Compatibility
One ready-made build per engine version is included in the download β copy the one that matches your project.
| Platform | Supported in |
|---|---|
| Windows | Editor & packaged |
| Linux | Editor & packaged |
| Android | Packaged builds |
| Module | Type | Loading phase |
|---|---|---|
| SocketGate | Runtime | Default |
Technical details
| Code modules | SocketGate (Runtime), SocketGateSdk (External, Source/ThirdParty - prebuilt AWS SDK for C++) |
|---|---|
| Blueprints | 0 Β· C++ classes: 8 |
| Network replicated | No |
| Development platforms | Windows: Yes, Mac: No, Linux: Yes |
| Target build platforms | Win64, Linux, Android |
| Third-party software | Yes - AWS SDK for C++ 1.11.916 and the AWS Common Runtime libraries (Apache-2.0), in Source/ThirdParty/SocketGateSdk |
| Engine versions | Unreal Engine 4.27 Β· 5.8 β a build for each is included |
| C++ classes | 8 + 2 structs |
| Blueprint nodes | 21 |
| Events | 9 |
| Documentation | Documentation.html (in the download) |
| Download | SocketGate.zip Β· 33.9 MB |
| Version | v1.0.0 |
What's in the download
| File | What it is |
|---|---|
| SocketGate 4.27.zip | Plugin build for Unreal Engine 4.27 |
| SocketGate 5.8.zip | Plugin build for Unreal Engine 5.8 |
| Documentation.html | Documentation (open in a browser) |
Quick start
- Unzip the download and pick the build that matches your engine (4.27 Β· 5.8).
- Copy the SocketGate folder into your project's Plugins/ folder (create it if needed).
- Open the project, enable SocketGate under Edit βΊ Plugins and restart the editor.
- Fill in Project Settings βΊ Plugins βΊ SocketGate.
- Right-click in any Blueprint graph and search SocketGate β or include the public headers from C++.
- Package for your target platform (Windows, Linux, Android).
Good to know
Built and verified warning-free for Unreal Engine 4.27 and 5.8. Requires an AWS account with an API Gateway WebSocket API; API Gateway, Lambda and Cognito usage is billed by AWS. The WebSocket connection uses the engine's WebSockets module; None and Token modes work without AWS credentials. On Linux and Android the SDK uses the engine's libcurl and OpenSSL and the engine's certificate store. On Win64 the SDK is one DLL with a plugin-specific name, so SocketGate can be installed next to other AWS-based plugins. Never ship long-term access keys in a game client: use a Cognito identity pool for players. Developed and maintained by Alpha XP.
Everything included
- Socket connection object with On Connected, On Message, On Closed, On Error and Onβ¦
- Send Text and Send Json Action ({"action": route, ...} for $request.body.action routing)
- $connect authorization: None, IAM (presigned SigV4 URL) or Token (header or queryβ¦
- Extra headers, query parameters and WebSocket subprotocols
- Auto-reconnect with exponential back-off and jitter; a fresh signed URL for every attempt
- Keep-alive message against API Gateway's 10-minute idle timeout
- Send And Wait For Reply: request/response matched by a generated requestId, with timeout
- Server side: Post To Connection, Get Connection, Delete Connection
- Amazon Cognito identity pools for guest and signed-in players; static keys and theβ¦
- Active connections are kept alive and closed automatically when the game instanceβ¦
- Struct To JSON, JSON To Struct and Get JSON Field helpers
- Project Settings page for every default
Platforms
Requirements
- Unreal Engine 4.27 and 5.8
- Develop on Windows (Win64)
- Blueprints and C++
In the download
Personal
One non-commercial project
- 1 activation seat
- 1 year of updates
- One end product
- Non-commercial use
- Community support
- 14-day refund window
Commercial
Ship paid products
- 5 activation seats
- 1 year of updates
- One paid end product
- Unlimited end users
- Priority support
- Source files
- 14-day refund window
Extended
Resell & white-label
- Unlimited activation seats
- Lifetime updates
- Unlimited end products
- White-label & resell
- 1-hour SLA
- Seat-free team use
- 14-day refund window
One purchase per product, no subscription. Each licence comes with a signed key β 1 seat on Personal, 5 seats on Commercial, unlimited seats on Extended. Paid licences can be refunded within 14 days from your order page.
- v1.0.0Latest
- Unreal Engine 4.27 and 5.8
- Blueprint and C++ API, HTML documentation
Be the first to review SocketGate β reviews come from customers who bought it, so every one is a verified purchase.
Frequently asked
How do I get the files after paying?
Straight after checkout you land on your order page with the download button and your licence key. A receipt is emailed to you, and every order stays in My library.
Which licence do I need?
Personal β One non-commercial project. Commercial β Ship paid products. Extended β Resell & white-label. The Licences tab compares them side by side.
On how many devices can I activate it?
1 seat on Personal, 5 seats on Commercial, unlimited seats on Extended.
How long do I get updates?
Personal: 1 year of updates, Commercial: 1 year of updates, Extended: lifetime updates, counted from your purchase.
Can I get a refund?
Yes β paid licences can be refunded within 14 days, straight from your order page.
Is the download safe?
The file was scanned with ClamAV when it was published. Its SHA-256 checksum is listed under Features β In the download, so you can verify the file you receive.
Do I need an account?
No. Checkout only needs your email. Signing in keeps all your purchases, keys and downloads together in My library.
More like this
AudioLens
Real-time audio analysis: FFT spectrum, onset and beat detection, and a full set of time- and frequency-domain descriptors..
β β β β β No reviews yetTTechHarbour$14.00BlueprintTCP
BlueprintTCP lets you connect to any TCP server and exchange data entirely from Blueprints β no C++ and no networking boilerplate.
β β β β β No reviews yetTTechHarbour$12.99BluetoothLink
Bluetooth Low Energy for Unreal - scan, connect, read, write and subscribe to BLE devices on Android and iOS.
β β β β β No reviews yetTTechHarbour$11.99ClusterLink
SocketCluster realtime client for Unreal - pub/sub channels, auth engine and JSON codec, usable from Blueprints.
β β β β β No reviews yetTTechHarbour$11.99