lua-resty-websocket icon indicating copy to clipboard operation
lua-resty-websocket copied to clipboard

websocket client example

Open gitdhar opened this issue 5 years ago • 1 comments

Using the websocket client (from sample code in the README), I get this error below: " ./openresty/lualib/resty/websocket/protocol.lua:21: attempt to index global 'ngx' (a nil value) "

I did set the package path as required. package.path = package.path .. ";./openresty/?.lua

Is there a working sample for websocket client?

gitdhar avatar Dec 31 '18 08:12 gitdhar

@gitdhar Please provide a minimal and self-contained example that can reproduce this. The ngx global variable should always be there in the context of OpenResty (or ngx_lua). There must be something very wrong in your OpenResty setup.

agentzh avatar Feb 04 '19 02:02 agentzh