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

websocket client example #40

Open
gitdhar opened this issue Dec 31, 2018 · 1 comment
Open

websocket client example #40

gitdhar opened this issue Dec 31, 2018 · 1 comment

Comments

@gitdhar
Copy link

gitdhar commented Dec 31, 2018

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?

@agentzh
Copy link
Member

agentzh commented Feb 4, 2019

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

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