mirror of
https://github.com/openresty/openresty.git
synced 2024-10-13 00:29:41 +00:00
Add abstract socket support on Linux
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 -
This commit is contained in:
@ -394,6 +394,13 @@ if [ "$answer" = "N" ]; then
|
||||
echo
|
||||
fi
|
||||
|
||||
answer=`$root/util/ver-ge "$main_ver" 1.13.6`
|
||||
if [ "$answer" = "Y" ]; then
|
||||
echo "$info_txt applying the linux_abstract_sockets patch for nginx"
|
||||
patch -p1 < $root/patches/nginx-$main_ver-linux_abstract_sockets.patch || exit 1
|
||||
echo
|
||||
fi
|
||||
|
||||
if [ "$main_ver" = "1.9.7" ]; then
|
||||
echo "$info_txt applying the resolver_security_fixes patch for nginx"
|
||||
patch -p1 < $root/patches/nginx-$main_ver-resolver_security_fixes.patch || exit 1
|
||||
|
||||
Reference in New Issue
Block a user