|
Cro: libraries and tools for building reactive services in Perl 6 | cro.services/ | Logs: irclog.perlgeek.de/cro/ Set by moderator on 22 May 2018. |
|||
|
00:11
lizmat joined
01:28
Qwerasd joined
01:58
ilbot3 joined
|
|||
| moderator | Cro: libraries and tools for building reactive services in Perl 6 | cro.services/ | Logs: irclog.perlgeek.de/cro/ | ||
|
10:00
Qwerasd joined
18:33
Qwerasd joined
|
|||
| Qwerasd | jnthn: Sorry to bother if you're busy. Have you gotten a moment to try to figure out that websocket connection? Yesterday you said you'd see if you could find a moment to do it tomorrow. | 19:15 | |
| The connection in question being (Cro::WebSocket::Client.new: uri => 'wss://gateway.discord.gg').connect(ca => { :none }) and the issue being that the server 404s (The connection works in other websocket implementations I've tries such as in node.js) | 19:16 | ||
| jnthn | Qwerasd: I reproduced the 404, at least. The request looks OK to me. | 20:38 | |
| Qwerasd | So no clue what's wrong then? :\\ | 20:44 | |
| jnthn | I've found it :/ | 20:45 | |
| Geth | cro-websocket: f44bc68c1c | (Jonathan Worthington)++ | lib/Cro/WebSocket/Client.pm6 Don't force use of a ca for wss:// |
20:46 | |
| cro-websocket: 109b22e24a | (Jonathan Worthington)++ | lib/Cro/WebSocket/Client.pm6 Force HTTP/1.1 when making WS connection Even if the server can do HTTP/2.0, we can't do a WebSocket handshake that way, as it's against the specification. |
|||
| Qwerasd | Ah. Any clue how I could fix that? | 20:47 | |
| jnthn | Currently testing a patch | 20:53 | |
| Qwerasd | Great! | 20:54 | |
| Geth | cro-websocket: 4bf2d99bfd | (Jonathan Worthington)++ | lib/Cro/WebSocket/Client.pm6 Fix various issues with URI handling * Use Cro::Uri to do any concatenation, so any relative path parts will get properly resolved * Make sure that we map ws:// and wss:// into http:// and https:// respectively before passing them on to the HTTP client to perform the handshake. |
20:57 | |
| jnthn | Qwerasd: Uninstall your current Cro::WebSocket (zef uninstall Cro::WebSocket), clone the repo there, go into it, and `zef install .` | ||
| Sorry for the inconvenience. | 20:58 | ||
| Qwerasd | I appreciate the help! | ||
| jnthn | Ah, and let me know if it doesn't help, of course | 20:59 | |
| jnthn away for a bit | 21:02 | ||
| Qwerasd | It works! I think. | 21:04 | |
| How would I print the content of any messages that are recieved? | 21:05 | ||
| jnthn | Something like: react whenever $connection.messages -> $message { say await $message.body-text } | 21:07 | |
| Or body-blob if it's a binary protocol | |||
| Qwerasd | It works! Thank you so much for the help! | 21:08 | |
| jnthn | \\o/ | 21:16 | |
| jnthn really away this time :) | |||