Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebSocketProvider accepts an URLRequest to connect #122

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

marionauta
Copy link
Contributor

In addition to URL, you can use a URLRequest to WebSocketProvider to connect to. This is needed for connecting to sync servers that require custom headers, for example.

var request = URLRequest(url: URL(string: "wss://example.com")!)
request.addValue("token", forHTTPHeaderField: "Authorization") // for example
let websocket = WebSocketProvider(.default)
websocket.connect(to: request)

@heckj
Copy link
Collaborator

heckj commented Nov 1, 2024

Nice! Thanks for the refactoring to provide accepting URLRequest as well as URL!

@heckj heckj self-requested a review November 1, 2024 15:08
@heckj heckj merged commit b9f167d into automerge:main Nov 1, 2024
1 check 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.

2 participants