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

Postman can not connect to the Example EchoServer #220

Open
seyedjafariy opened this issue Nov 11, 2023 · 0 comments
Open

Postman can not connect to the Example EchoServer #220

seyedjafariy opened this issue Nov 11, 2023 · 0 comments

Comments

@seyedjafariy
Copy link

I copied the README example server EchoServer to a swift app with a MacOS target

trying to connect to the server using telnet succeeds as documented, but using postman or Insomnia connection fails with:

Error: Parse Error: Expected HTTP/

After updating the first write message to this:

                        let startingMessage = """
                        HTTP/1.1 101 Switching Protocols
                        Date: "\(Date.now)"
                        Connection: "Upgrade"
                        Upgrade: "websocket"
                        Sec-WebSocket-Accept: "\(base64Response)"
                        """
                        
                        try socket.write(from: startingMessage)

the error goes away, however, the connection freezes on the Postman/Insomnia and no Frames can be sent/received.

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

No branches or pull requests

1 participant