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

WSS Support for Sync & Copas #91

Merged
merged 13 commits into from
Apr 28, 2016
Merged

WSS Support for Sync & Copas #91

merged 13 commits into from
Apr 28, 2016

Conversation

NovusTheory
Copy link
Contributor

@NovusTheory NovusTheory commented Apr 22, 2016

NOTE: You verify certificate yourself, via ssl_params

Okay, this is an extremely rough draft and probably will contain a lot bugs to admit, it was tested on an actual server and it seems to work fine.

I will probably start working on the other ones soon.

LuaSec dependency now required for WSS support.

If you have issues with WSS please tag me in them so I can be sure to look at them

**DO NOT USE FOR PRODUCTION USE**

This is an **extremely** rough edition and adds **extremely** minimal support for WSS and does not verify SSL Certificates
Add WebSocketSecure support
Instead of preset SSL parameters you provide your own (required), look at LuaSec for information on parameters
This is a "working" version that has been tested on a *real* server and it seems to respond perfectly fine, however, this is not the final version and bugs are present
@NovusTheory
Copy link
Contributor Author

CI failed ;(

@lipp
Copy link
Owner

lipp commented Apr 26, 2016

@NovusTheory thx! The CI must succeed though :( Did you try to run the docker env for testing locally?

@NovusTheory
Copy link
Contributor Author

@lipp I'll run the stuff locally and try to get the CI to pass that way it can be added in

@coveralls
Copy link

coveralls commented Apr 27, 2016

Coverage Status

Coverage decreased (-0.2%) to 91.097% when pulling a7a52b7 on NovusTheory:master into 1ec1ac6 on lipp:master.

@NovusTheory
Copy link
Contributor Author

NovusTheory commented Apr 27, 2016

@lipp Took me a pain to get this but here the CI passed

I'm done with travis for life

@lipp lipp merged commit 12c593a into lipp:master Apr 28, 2016
@lipp
Copy link
Owner

lipp commented Apr 28, 2016

💯 awesome! thanks a lot! Indeed, setting up travis etc with lua and stuff is a pain. That's why I like node.js. So much better support / tooling!

@NovusTheory NovusTheory mentioned this pull request Apr 28, 2016
@NovusTheory NovusTheory changed the title WSS Support for Sync WSS Support for Sync & Copas May 3, 2016
@NovusTheory
Copy link
Contributor Author

NovusTheory commented May 3, 2016

@lipp I did some testing with this code and I changed the title to respectively say Copas does work with this Pull Request also, I'm still working on ev though which seems to be giving me some issues

local websocket = require'websocket'
local client = websocket.client.copas()

local params = {
    mode = "client",
    protocol = "sslv23",
    verify = "none",
    options = {"all"}
}


local c = coroutine.create(function()
    client:connect('wss://echo.websocket.org','echo',params)
end)

while true do
    local alive = coroutine.resume(c)
    if not alive then
       break
    end
end

for i = 1, 10 do
    local echo = coroutine.create(function()
        client:send('Hello')
        print(client:receive())
    end)

    while true do
        local alive = coroutine.resume(echo) 
        if not alive then
            break
        end
    end
end

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

Successfully merging this pull request may close these issues.

None yet

3 participants