lipp / lua-websockets

Websockets for Lua.
http://lipp.github.com/lua-websockets/
MIT License
396 stars 113 forks source link

Compatibility with Lua 5.3? #107

Open jeffmikels opened 6 years ago

jeffmikels commented 6 years ago

I need to use Lua 5.3, but lua-websockets depends on luabitop which can't work with 5.3.

What are my options?

FrankBuchholz commented 4 years ago

I tried to use Lua 5.3 in the x64-Version but failed, too:

  1. I could solve the issue about bit.lua by creating my own (incomplete) file which basically wraps built-in operators from Lua 5.3 into functions:: return { band = function(a, b) return a & b end; bor = function(a, b) return a | b end; bxor = function(a, b) return a ~ b end; bnot = function(x) return ~ x end; lshift = function(x, n) return x << n end; rshift = function(x, n) return x >> n end; arshift = function(x, n) print('arshift missing') return x end; rol = function(x, n) return (x<<(n%64))|(x>>(64-(n%64))) end; ror = function(x, n) return (x>>(n%64))|(x<<(64-(n%64))) end; bswap = function(x) print('bswap missing') return x end; }

  2. However, this is not sufficient : The client of the test-server-copas still reports the error "Error during WebSocket handshake: Incorrect 'Sec-WebSocket-Accept' header value"

Now I'm looking for different libraries like https://github.com/daurnimator/lua-http