ksdaemon / loowy Goto Github PK
View Code? Open in Web Editor NEWLua WAMP client
License: MIT License
Lua WAMP client
License: MIT License
Argument is obj
but using object
https://github.com/KSDaemon/Loowy/blob/master/src/loowy/client.lua#L271
Hi,
I get an error as follows in a basic client with lua-websockets v2.1-1, lua 5.1. It seems that you pass a table of protocols, while ws:connect expects just one. It worked for me when I changed this [0] line to read:
ws:connect(cache.url, cache.protocols[1])
so I just selected first element.
Do you think it is a bug and the solution is fine? Or is this some how intended?
Thanks!
[0] https://github.com/KSDaemon/Loowy/blob/master/src/loowy/client.lua#L875
CALLBACK FAILED: /usr/local/share/lua/5.1/websocket/handshake.lua:53: invalid value (table) at index 1 in table for 'concat'
stack traceback:
[C]: in function 'concat'
/usr/local/share/lua/5.1/websocket/handshake.lua:53: in function 'upgrade_request'
/usr/local/share/lua/5.1/websocket/client_ev.lua:133: in function </usr/local/share/lua/5.1/websocket/client_ev.lua:129>
[C]: in function 'loop'
client.lua:29: in main chunk
[C]: ?
I can't see the error messages that catched while running RPCs. This greatly complicates the development process.
It would be nice to add the RPC error logging in debug mode :-)
Run with the test.lua in the project, get the following error:
Connecting client to WAMP Server: ws://xxxx/ws/
[DEBUG] (string) "websocket OnOpen event fired"
CALLBACK FAILED: /Users/mac/.luarocks/share/lua/5.2/loowy/client.lua:497: bad argument #1 to 'match' (string expected, got nil)
stack traceback:
[C]: in function 'match'
/Users/mac/.luarocks/share/lua/5.2/loowy/client.lua:497: in function '_wsOnOpen'
/Users/mac/.luarocks/share/lua/5.2/loowy/client.lua:914: in function 'user_on_open'
/Users/mac/.luarocks/share/lua/5.2/websocket/client_ev.lua:73: in function 'on_open'
/Users/mac/.luarocks/share/lua/5.2/websocket/client_ev.lua:186: in function </Users/mac/.luarocks/share/lua/5.2/websocket/client_ev.lua:152>
the 497 line in client.lua:
options.transportEncoding = string.match(wsProtocol,'.*%.([^.]+)$')
the wsProtocol is nil, can't figure out how to fix it. (If I comment out the 497 line it runs without problem)
I'm wondering if it's feasible to implement the client on top of lua coroutine, @KSDaemon can you point out a roughly way to do this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.