niv / websocket.nim

websockets for nim
http://niv.github.io/websocket.nim/docs/0.1.1/websocket.html
Other
101 stars 25 forks source link

Client fails to send trailing "\r\n", connection never happens #23

Closed luked99 closed 6 years ago

luked99 commented 6 years ago

The client needs to send a trailing "\r\n" (a final blank line) but that seems not to happen. As a result it can never connect.

luked99 commented 6 years ago

I think the problem was introduced by the most recent commit, from @Araq. This change in newAsyncWebsocket():

-  await s.send("\c\L")
+  await s.send(msg)

To fix it, it just needs to append, something like this:

+msg.add("\c\L")
await s.send(msg)

I can do a pull request tomorrow.