Skip to content

feat: Add support for WebSocket path in UnityTransport#3901

Merged
michalChrobot merged 2 commits intodevelop-2.0.0from
feat/websocket-paths
Mar 17, 2026
Merged

feat: Add support for WebSocket path in UnityTransport#3901
michalChrobot merged 2 commits intodevelop-2.0.0from
feat/websocket-paths

Conversation

@simon-lemay-unity
Copy link
Contributor

Purpose of this PR

For a few versions now UTP has supported setting the URL path that's going to be used for WebSockets (e.g. if you want to connect to wss://foobar.com/somewhere instead of just wss://foobar.com). That capability has not been exposed to NGO however. It was possible to still get access to this setting by using a custom driver constructor, but that's a bit of a heavy solution for such a simple thing.

This PR remedies that by allowing users to directly set the URL path on the UnityTransport component. This is done through a new field in ConnectionData that only shows up in the inspector if using WebSockets. This is just then routed to the appropriate setting in UTP.

This was suggested by a user here, showing that there is some interest for this feature.

Jira ticket

None. Didn't want to bother creating one.

Changelog

  • Added: Added a WebSocketPath field to UnityTransport.ConnectionData (which also shows up in the inspector if "Use WebSockets" is checked) that controls the path clients will connect to and servers/hosts will listen on when using WebSockets.

Documentation

  • Includes edits to existing public API documentation.

Testing & QA (How your changes can be verified during release Playtest)

Functional Testing

Manual testing :

  • Manual testing done

Automated tests:

  • Covered by existing automated tests
  • Covered by new automated tests

Does the change require QA team to:

  • Review automated tests?
  • Execute manual tests?
  • Provide feedback about the PR?

Backports

No. Couldn't backport even if I wanted to since WebSockets are UTP 2.X+.

@simon-lemay-unity simon-lemay-unity requested review from a team as code owners March 16, 2026 16:14
Copy link
Member

@michalChrobot michalChrobot left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Copy link
Member

@EmandM EmandM left a comment

Choose a reason for hiding this comment

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

I have a PR pending to stop testing PRs on trunk, once that lands the tests should pass and this should be good to go!

Thanks for the quick turnaround!

@simon-lemay-unity simon-lemay-unity enabled auto-merge (squash) March 16, 2026 20:52
@michalChrobot
Copy link
Member

FYI the error should be resolved after #3902 lands (as this is trunk related)

Anyway, as this is not your PR issue I'm going to merge this already (it was approved + you enabled auto-merge)

@michalChrobot michalChrobot disabled auto-merge March 17, 2026 09:40
@michalChrobot michalChrobot merged commit 6c2db82 into develop-2.0.0 Mar 17, 2026
20 of 26 checks passed
@michalChrobot michalChrobot deleted the feat/websocket-paths branch March 17, 2026 09:40
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.

3 participants