Comments (14)
@webandbusiness Please provide the raw error message you actually see instead of summarizing your own version. Thank you.
from stream-lua-nginx-module.
-----------------------------------extraction of my conf file-------------------------
#user nobody;
worker_processes 2;
error_log logs/error.log;
error_log logs/error.log notice;
error_log logs/error.log info;
pid logs/nginx.pid;
events {
worker_connections 1024;
}
stream {
# define a TCP server listening on the port 1234:
server {
listen 1234;
content_by_lua_block {
ngx.say("Hello, Lua!")
}
}
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
lua_shared_dict cachestore 1M;
lua_socket_log_errors off;
gzip on;
lua_code_cache off;
init_by_lua_file dynamic/config.lua;
server {
listen 80;
server_name localhost;
location /{
root html;
index index.html index.htm;
}
-----------------------------------extraction of my conf file-------------------------
As soon i launch the openresty ver 1.11.2.1 server, on windows SP3.
It stops and log error:
2016/09/28 22:27:08 [emerg] 4232#4824: "content_by_lua_block" directive is not allowed here in ./conf/nginx.conf:21
from stream-lua-nginx-module.
hello any idea.?
is there any or another way to do raw tcp server with openresty.
i am still pending
Thanks for all done so far.
regards
from stream-lua-nginx-module.
@webandbusiness BTW, if you want to paste the source here, please honor the markdown format. As you can see above, your comments are unreadable when rendered by github's web UI. Thanks for your attention.
from stream-lua-nginx-module.
@webandbusiness Your error message is a clear indication that your nginx has compiled in the ngx_http_lua_module but not ngx_stream_lua_module. You need to have both for your nginx.conf
to run properly.
from stream-lua-nginx-module.
Hello, after trying others solution without success, i comeback and compiled openresty sources ver 1.11.2.5 with Luajit2.0.5 and ngx_stream_lua_module at running on commandline i got segmentation fault...with stream directive in conf
No error without stream directive
What can be the problem
Thanks
from stream-lua-nginx-module.
My system is Debian 32bit dual core
from stream-lua-nginx-module.
@webandbusiness Two things:
- OpenResty 1.11.2.5 already bundles with LuaJIT 2.1. Do not use your own LuaJIT here.
- the latest master branch of
ngx_stream_lua_module
requires NGINX 1.13.3+. It's documented in its README file.
from stream-lua-nginx-module.
Ok so the better solution is to avoid openresty? and instead join
nginx 1.13.x + Luajit2.1+lua-nginx-module+ngx_stream_lua_module to have a http+tcp server all in one?
Right
from stream-lua-nginx-module.
@webandbusiness Not really. For the best result, you should use the following OpenResty preview version instead:
https://openresty.org/download/openresty-1.13.4.1rc0.tar.gz
Then you can compile the latest git master branch of stream-lua-nginx-module like this:
./configure --with-stream --with-stream_ssl_module \
--add-module=/path/to/stream-lua-nginx-module -j8
make -j8
sudo make install
Please me know how it works. It compiles fine on my side at least.
from stream-lua-nginx-module.
BTW, we'll probably bundle and enable ngx_stream_lua_module
by default in the next OpenResty formal version (probably 1.13.4.1) if everything goes well.
from stream-lua-nginx-module.
Hello, i tried several times and ways, but i end up with the following error.
-L/root/openresty-1.13.4.1rc0/build/luajit-root/opt/openresty/luajit/lib -L/root/openresty-1.13.4.1rc0/build/luajit-root/opt/openresty/luajit/lib -Wl,-rpath,/opt/openresty/luajit/lib -Wl,-E -Wl,-E -ldl -lpthread -lcrypt -L/root/openresty-1.13.4.1rc0/build/luajit-root/opt/openresty/luajit/lib -lluajit-5.1 -lm -ldl -L/root/openresty-1.13.4.1rc0/build/luajit-root/opt/openresty/luajit/lib -lluajit-5.1 -lm -ldl -lpcre -lssl -lcrypto -ldl -lz \ -Wl,-E objs/addon/src/ngx_stream_lua_util.o: In function
ngx_stream_lua_free_session':
/root/stream-lua-nginx-module-0.0.1/src/ngx_stream_lua_util.c:3220: undefined reference to ngx_stream_close_connection' /root/stream-lua-nginx-module-0.0.1/src/ngx_stream_lua_util.c:3205: undefined reference to
ngx_stream_close_connection'
collect2: error: ld returned 1 exit status
objs/Makefile:448: recipe for target 'objs/nginx' failed
make[2]: *** [objs/nginx] Error 1
make[2]: Leaving directory '/root/openresty-1.13.4.1rc0/build/nginx-1.13.4'
Makefile:8: recipe for target 'build' failed
make[1]: *** [build] Error 2
make[1]: Leaving directory '/root/openresty-1.13.4.1rc0/build/nginx-1.13.4'
Makefile:4: recipe for target 'all' failed
make: *** [all] Error 2
`
from stream-lua-nginx-module.
@webandbusiness I said you should use the latest master branch of stream-lua-nginx-module but you seems to be still using the old tagged version. Alas.
from stream-lua-nginx-module.
Perfect!!!!!!!!!!
Fixed it, Thanks so much, for everything your doing
The power and reputation of openresty should allow TCP low level management to implement so many other protocols like mqtt.... and userdefined protocols also.
Indeed TCP should be allow by default in the next coming OPENRESTY
Long Live to Openresty
Good Job agentzh
from stream-lua-nginx-module.
Related Issues (20)
- Why is the preread method in the stream subsystem called after receiving at least 5 bytes?
- ngx_stream_lua_worker.c:124:8: error: ‘ngx_core_conf_t’ has no member named ‘privileged_agent_connections’ HOT 4
- Lua blocks cannot coexist with proxy_pass, only proxy_pass is executed when proxy_pass is present HOT 1
- ngx.say could not use in udp mode?
- TLS connections failing on `init_worker` HOT 1
- 【help】 tcp request报文修改 HOT 1
- Openresty build with Option:--without-http_ssl_module --without-stream_ssl_module failed HOT 1
- tha lastest openresty and stream-lua-nginx-module ,has no member named ‘privileged_agent_connections’ HOT 1
- ld: symbol(s) not found for architecture x86_64 HOT 2
- content_by_lua_block not working with tcp proxy_pass. HOT 1
- Feature: sendupstream() similar to njs
- [help wanted] how can I reset ngx.req.socket in context:preread
- [Improvement] Add License File to Project HOT 2
- Will nginx1.21.5 still be supported? HOT 7
- feature required: support PCRE2 HOT 7
- starttls HOT 1
- When using OpenResty as a proxy for forwarding TCP traffic, how can I obtain the address of the backend server that the client wants to access from the captured traffic? HOT 9
- About the timeout period HOT 2
- nginx "content_by_lua_block" directive is not allowed here HOT 3
- Would love `access_by_lua_block` HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stream-lua-nginx-module.