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

Websocket integration #54

Closed
quinnj opened this issue May 27, 2017 · 5 comments
Closed

Websocket integration #54

quinnj opened this issue May 27, 2017 · 5 comments

Comments

@quinnj
Copy link
Member

quinnj commented May 27, 2017

It'd be nice to support websocket upgrade requests in an HTTP.Server, as well as have websocket client functionality as well.

cc: @sarvjeethghotra

@iblislin
Copy link
Contributor

please checkout DandelionWebSockets and this PR as well:
dandeliondeathray/DandelionWebSockets.jl#5

@EricForgy EricForgy mentioned this issue Dec 11, 2017
@EricForgy
Copy link
Contributor

EricForgy commented Dec 11, 2017

I'm by no means an expert, but I'd love to see websockets integration. Any pointers how to get started? Maybe I could try to help.

Edit: I'm interested in seeing WSs integrated into the server.

@samoconnor
Copy link
Contributor

I've implemented a simple WebSockets client as a way to get test coverage of Connection: Upgrade. Adding server support should be straight forward.

The API is like this...

HTTP.WebSockets.open("wss://echo.websocket.org") do io
        write(io, "Foo")
        @test !eof(io)
        @test String(readavailable(io)) == "Foo"

        write(io, Vector{UInt8}("Hello"))
        write(io, " There")
        write(io, " World", "!")
        closewrite(io)

        buf = IOBuffer()
        write(buf, io)
        @test String(take!(buf)) == "Hello There World!"

        close(io)
    end

https://github.com/samoconnor/HTTP.jl/blob/simplify_parser_branch/test/WebSockets.jl

@samoconnor
Copy link
Contributor

This now supports client and server WebSockets: https://github.com/JuliaWeb/HTTP.jl/blob/master/src/WebSockets.jl

@EricForgy is also working on integreating HTTP.jl with the other WebSockets.jl package: https://github.com/JuliaWeb/WebSockets.jl/commits/change_dependencies

@samoconnor
Copy link
Contributor

Websockets client and server is now implemented here and over at WebSockets.jl.
Please open a new issue if you encounter a problem.

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

4 participants