Giter Club home page Giter Club logo

Comments (9)

FrankBuchholz avatar FrankBuchholz commented on August 16, 2024 1

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.lua 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

from lua-websockets.

lipp avatar lipp commented on August 16, 2024

By requiring single modules you can circumvent auto require copas. e.g.
require('websockets.client_ev')

PRs welcome 👍

from lua-websockets.

ntd avatar ntd commented on August 16, 2024

copas supports Lua 5.3 since 2.0.1. No PRs needed, at least not for copas 😉

The module that creates problem seems to be luabitop. It would be great if we can conditionally drop that dependency for Lua > 5.1.

I can take a look at it when I will need 5.3 support, but this will take a couple of months.

from lua-websockets.

RussellHaley avatar RussellHaley commented on August 16, 2024

I just bumped into this issue. I guess I'll subscribe to this thread. Thanks.

from lua-websockets.

RussellHaley avatar RussellHaley commented on August 16, 2024

Hi there, I'm still stuck on this. Can anyone help? I was told 5.3 shouldn't need luabitop?

from lua-websockets.

moteus avatar moteus commented on August 16, 2024

I think for now it does not suppurt bit operations on Lua 5.3.
And because there no bit32 module I suggest use bit32 from luarocks. It works fine on Lua 5.3.
Or you can make PR to add support this. :)

from lua-websockets.

RussellHaley avatar RussellHaley commented on August 16, 2024

Would replacing bit.lua with this help?

https://github.com/daurnimator/lua-http/blob/master/http/bit.lua

from lua-websockets.

moteus avatar moteus commented on August 16, 2024

You also need shift operations. Checkou my variant.
https://github.com/moteus/lua-lluv-websocket/blob/master/src/lluv/websocket/bit.lua

from lua-websockets.

robertlzj avatar robertlzj commented on August 16, 2024

For bitop, there is a fork from https://github.com/LuaDist/luabitop, which support Lua 5.3 (and provide bit.dll etc).
(And there is more forks from original luabitop)

But with further test, I get error attempt to call a nil value (global 'unpack') at 'websocket\frame.lua', so means there is old incompatible Lua function.
Seems its easy to convert/update.. Replace unpack to table.unpack.

@FrankBuchholz Thank you for introduce https://github.com/daurnimator/lua-http (Dependency doesn't support Microsoft Windows operating systems).

from lua-websockets.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.