Conversation
|
Runs fine on a docker instance using the OUTPUTvis@cf2b1bee4a1a:~/openresty/openresty$ prove -I. -r t/
t/001-resolver.t .. 1/55 nginx: [emerg] IPv6 resolver address is too long: "2001:4860:4860::8888:2001:4860:4860::8888:2001" in /home/travis/openresty/openresty/t/servroot/conf/nginx.conf:39
nginx: [emerg] unable to parse local resolver in /home/travis/openresty/openresty/t/servroot/conf/nginx.conf:39
WARNING: TEST 10: IPv6 with malformed and long address - 2019/08/02 08:51:39 [emerg] 25941#0: IPv6 resolver address is too long: \"2001:4860:4860::8888:2001:4860:4860::8888:2001\" in /home/travis/openresty/openresty/t/servroot/conf/nginx.conf:39 at /usr/local/share/perl/5.18.2/Test/Nginx/Socket.pm line 1247.
WARNING: TEST 10: IPv6 with malformed and long address - 2019/08/02 08:51:39 [emerg] 25941#0: unable to parse local resolver in /home/travis/openresty/openresty/t/servroot/conf/nginx.conf:39 at /usr/local/share/perl/5.18.2/Test/Nginx/Socket.pm line 1247.
nginx: [emerg] no name servers defined in /home/travis/openresty/openresty/t/servroot/conf/nginx.conf:39
WARNING: TEST 2: malformed file - 2019/08/02 08:51:39 [emerg] 25953#0: no name servers defined in /home/travis/openresty/openresty/t/servroot/conf/nginx.conf:39 at /usr/local/share/perl/5.18.2/Test/Nginx/Socket.pm line 1247.
t/001-resolver.t .. 39/55 nginx: [emerg] no name servers defined in /home/travis/openresty/openresty/t/servroot/conf/nginx.conf:39
WARNING: TEST 3: disabled - 2019/08/02 08:51:42 [emerg] 26043#0: no name servers defined in /home/travis/openresty/openresty/t/servroot/conf/nginx.conf:39 at /usr/local/share/perl/5.18.2/Test/Nginx/Socket.pm line 1247.
t/001-resolver.t .. ok
t/sanity.t ........ 270/273 wrote t/sanity.t_
t/sanity.t ........ ok
All tests successful.
Files=2, Tests=328, 17 wallclock secs ( 0.08 usr 0.00 sys + 4.60 cusr 8.77 csys = 13.45 CPU)
Result: PASS |
This adds abstract socket support for Linux, making it possible
to do for example:
server {
listen unix:@abstract-socket;
location / {
content_by_lua_block {
ngx.say("hello from @abstract-socket")
}
}
location /abstract-socket {
content_by_lua_block {
local sock = ngx.socket.tcp()
local ok, err = sock:connect("unix:@abstract-socket")
if not ok then
return ngx.say("could not connect: ", err)
end
ok, err = sock:send("GET /\r\n");
if not ok then
return ngx.say("failed to send data on socket")
end
ngx.say(sock:receive())
}
}
}
echo -en "GET /abstract-socket\r\n" | \
socat abstract-connect:abstract-socket -
- Fixed a length bug that would ocure when the socket name was not zero terminated.
xiaocang
force-pushed
the
linux-abstract-socket-support
branch
from
January 20, 2022 15:40
ebd6084 to
568889b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds abstract socket support for Linux, making it possible
to do for example:
server {
listen unix:@abstract-socket;
}
echo -en "GET /abstract-socket\r\n" |
socat abstract-connect:abstract-socket -
I hereby granted the copyright of the changes in this pull request
to the authors of this openresty project.