-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hello, In the native app, the Websocket protocol can lead to error because it doesn't act like the web interface. When we are using the WebSocket API (in the browser), it add automatically some headers - like the `Origin` header. In fact this header is mandatory, as explained in the RFC : - <https://datatracker.ietf.org/doc/html/rfc6455> ```text 8. The request MUST include a header field with the name |Origin| [[RFC6454](https://datatracker.ietf.org/doc/html/rfc6454)] if the request is coming from a browser client. If the connection is from a non-browser client, the request MAY include this header field if the semantics of that client match the use-case described here for browser clients. The value of this header field is the ASCII serialization of origin of the context in which the code establishing the connection is running. See [[RFC6454](https://datatracker.ietf.org/doc/html/rfc6454)] for the details of how this header field value is constructed. ``` However, if we don't set the `Origin` header in the native app, the app "could" not act the same as in the browser In this PR, I had the Origin header to the client. Note that - the PR to add a header in tungstenite is quite new : snapview/tungstenite-rs#400 - a new version of tungstenite has not been released yet (so this PR is kind of a draft) Thanks --------- Co-authored-by: Emil Ernerfeldt <[email protected]>
- Loading branch information
1 parent
f396ba0
commit 50c510e
Showing
5 changed files
with
99 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters