]> gitweb.factorcode.org Git - factor.git/commit
http.websockets: Initial commit websockets
authorDoug Coleman <doug.coleman@gmail.com>
Wed, 22 Dec 2021 18:10:36 +0000 (12:10 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Wed, 22 Dec 2021 18:10:36 +0000 (12:10 -0600)
commit75fc55dfbfe50cc319bba95efbf8133568395cde
tree2b976d396769a3b872ead4f13aa246b90cd2b174
parent893d4e43840a995afd1a44ebe9d4ff584fa23ff4
http.websockets: Initial commit

Need to factor out add-origin-header and handling the connections. The
http integration is a little sloppy as well.

Try this:

"demo.piesocket.com/v3/1?api_key=oCdCMcMPQpbvNjUIzqtvF1d2X2okWpDQj4AwARJuAgtjhzKxVEjQU6IdCjwm&notify_self=1"

<get-request> add-websocket-headers http-request* nip
[ in>> stream>> ] [ out>> stream>> ] bi dup .
[
    ! "hello" f 1 f send-websocket-text
    [ B default-handle-websocket ] read-websocket-loop
] with-streams
basis/http/client/client.factor
basis/http/websockets/authors.txt [new file with mode: 0644]
basis/http/websockets/websockets.factor [new file with mode: 0644]