-
Notifications
You must be signed in to change notification settings - Fork 193
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
Fix web socket connection error #142
base: master
Are you sure you want to change the base?
Fix web socket connection error #142
Conversation
Hi there, and thanks for opening this PR. |
HI let url = URL(string: "wss://www.example.com/socketserver") This request will be processed in CustomHTTPPRotocol and will cause an error. In our bank we use your library, we configured and connected WebSocket connection, but it did not work. I made changes that do not allow us to initialize CustomHTTPProtocol and pass the wss connection further. Now everything works. But the query results do not get to Debugger. |
To test this, you can do a websocket connection and see that before my modification you will get an error, after there will be no error. But such connections will not be displayed in wormholy screen. I think update readme after merge pr |
@@ -42,6 +42,11 @@ public class CustomHTTPProtocol: URLProtocol { | |||
if CustomHTTPProtocol.property(forKey: Constants.RequestHandledKey, in: request) != nil { | |||
return false | |||
} | |||
|
|||
if request.url?.scheme == "wss" || request.url?.scheme == "ws" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we have a static property similar to ignoredHosts
that could be configured instead?
We've recently run into this issue whilst trying to use Starscream with native WebSocket APIs and we wouldn't necessarily be interested in logging any of the WebSocket traffic, but this would be our choice only; for us, ignoring specific hosts is not an option as we use AWS and it would be very difficult to manage. It would feel like a better approach rather than hardcode these exceptions like what is done here.
ignore ws and wss scheme connection for fix 1005 error when try to ws or wss scheme connect