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

New backend #49

Open
moteus opened this issue Feb 18, 2015 · 7 comments
Open

New backend #49

moteus opened this issue Feb 18, 2015 · 7 comments

Comments

@moteus
Copy link
Contributor

moteus commented Feb 18, 2015

I just imlement new backend for lua-websocket based on my libuv binding.
For now it implement same API as ev backend.
And I have several question:
1 To be avaliable you need add optional require to client/server files in main repo? (I have no objection to just merge my reto to this repo)
2 No all Linstners share same client set (clients table). Is it intentional or better if each server will have its own set?
3 To support wss protocol is it enough just make TLS connection?

@lipp
Copy link
Owner

lipp commented Feb 18, 2015

great 💯 ! nice work! i am looking forward to integrate that!!!

  1. maybe you could make a fork, add your new backend and make a PR?
    this would make communication much simpler.
  2. that is intentionally, since the clients are related to each server instance.
  3. I am not sure. This is maybe a https thing to look up. Other impl don't support secure cons for some reason:
    I really like Lua, but if you have the resources, users might just use a fullsize env like node.js or whatever. What do you think? Do you have wss scenarios?

There are some minor style things I'd like to keep homogenous.
Tests are required too (this may require add lluv support for busted 1.11.1 - I can do that).

@moteus
Copy link
Contributor Author

moteus commented Feb 19, 2015

maybe you could make a fork, add your new backend and make a PR?

Checkout #50

that is intentionally, since the clients are related to each server instance

OK. But in your code has problem when you start several servers in one process. But it rare.
You fill clients table when start server and this may override existed clients that alreade there from other server.
I think I make this optioanal.

I am not sure. This is maybe a https thing to look up. Other impl don't support secure cons for some >reason:
I really like Lua, but if you have the resources, users might just use a fullsize env like node.js or >whatever. What do you think? Do you have wss scenarios?

I need only server without wss. But if for wss needs only TLS connection and because it quite easy do I implement this one for client moteus/lua-lluv-websocket@9d8767d that works with `"wss://echo.websocket.org".
I realy do not know anything about wss but since it works I think it valid.
Server side is also simple as is.

Tests are required too (this may require add lluv support for busted 1.11.1 - I can do that).

I will be very appreciate because I never use busted.

@lipp
Copy link
Owner

lipp commented Feb 22, 2015

i'll extend busted to support lluv.

@lipp
Copy link
Owner

lipp commented Feb 22, 2015

making progress on that.
unfortunately the debug traceback (coxpcall) is not available when employing lluv. this is required for busted to correctly report errors.

   local trace
   local ok, err = suite.loop.xpcall(
      function()
        this_test.f(wrap_done(done))
      end,
      function(err)
        trace = debug.traceback("", 2)
         -- trace is nil using lluv !!!
        return err
     end)

@lipp
Copy link
Owner

lipp commented Feb 22, 2015

added a workaround ... as long as you dont want lluv officially supported by busted, no prob for me.
please try to add test using this busted version:

git clone https://github.com/lipp/busted/tree/1.11.1-uvll-support
cd 1.11.1-uvll-support
./try

this will install busted with lluv support. The test should prob look pretty much the ev_client/ev_server tests. You must call setloop('lluv') just like here https://github.com/lipp/lua-websockets/blob/master/spec/server_ev_spec.lua#L9.

@moteus
Copy link
Contributor Author

moteus commented Mar 1, 2016

I decide to release my version.
I did not use it in real life yet but It pass all autobahn tests (except some related with fast fall).
It support WSS and IPv6.
I implement test-server and basic echo client

I decide copy some files from your repo (because I make some changes to them and also because there no rockspec only for core and I do not add deps from all other lua-websockets deps like lua-ev etc)

You may be interested with my bit.lua file. It implement bit32 library for Lua 5.3 based on bit operators.
Also I use

  • tools.lua I add support for lbase64, basexx to support base64 encoding and lmd5, crypto and bgcrypto.sha to support sha1 digest.
  • frame.lua I add function decode_by_pos and return reserved bits as booleans.
  • handshake.lua I think I did not make any changes in this file.

@lipp
Copy link
Owner

lipp commented Mar 2, 2016

great! thanks for keeping me updated! The bit stuff for lua 5.3 could be very interesting for soon. sorry I wasnt so focused on lua-websockets lately. Unfortunately time is running very short with kids :) .

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

2 participants