Skip to content

Conversation

thediymaker
Copy link
Contributor

Description of Changes

Added support for wss:// protocol in Unreal SDK. The SDK previously forced all connections to use ws://, preventing connections to servers behind SSL/TLS proxies. The fix detects if the URI already includes a protocol (ws:// or wss://) and preserves it; otherwise defaults to ws:// for backward compatibility. This enables connections to SpacetimeDB servers hosted with Cloudflare Tunnels or other secure proxies.

API and ABI breaking changes

This change is fully backwards compatible. URIs without a protocol prefix will continue to work as before, with ws:// being automatically prepended. No API signatures or existing behavior has changed.

Expected complexity level and risk

Simple string prefix check before URL construction. The core WebSocket connection logic remains unchanged, and the default behavior is preserved when no protocol is specified.

Testing

Successfully tested with a wss:// connection to my self-hosted SpacetimeDB server behind Cloudflare Tunnel. Verified backward compatibility with protocol-less URIs when directly connecting to the server. Currently running without issues.

@CLAassistant
Copy link

CLAassistant commented Oct 2, 2025

CLA assistant check
All committers have signed the CLA.

@thediymaker thediymaker changed the title adding wss:// support Adding wss:// support for the Unreal SDK Oct 2, 2025
@JasonAtClockwork JasonAtClockwork self-assigned this Oct 2, 2025
@bfops
Copy link
Collaborator

bfops commented Oct 2, 2025

Thank you for submitting this! We'll get our resident Unreal wizard on it soon.

@JasonAtClockwork
Copy link
Contributor

Thanks again for this submission! I've updated it to reflect how our Unity SDK handles it to "support" http/https by translating to ws/wss.

Copy link
Collaborator

@jdetter jdetter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks excellent to me, however the CI job for unreal engine is failing and I don't really know why. We will likely either need to force merge or have someone look into the failure. I think it has something to do with this PR being an external contribution

@bfops bfops added this pull request to the merge queue Oct 3, 2025
Merged via the queue into clockworklabs:master with commit a16bfaa Oct 3, 2025
40 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants