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

Added new module: ngx_http_proxy_connect_module #1210

Merged
merged 1 commit into from Mar 19, 2019

Conversation

chobits
Copy link
Member

@chobits chobits commented Mar 14, 2019

  • Added ngx_http_proxy_connect_module
  • Added test cases
  • Added chinese/english documentation

@chobits chobits changed the title added new module: ngx_http_proxy_connect_module Added new module: ngx_http_proxy_connect_module Mar 15, 2019
@chobits chobits requested a review from wangfakang March 15, 2019 07:27
@chobits chobits added this to the 2.3.0 milestone Mar 15, 2019
@chobits
Copy link
Member Author

chobits commented Mar 15, 2019

New feature for 2.3.x, #1196.

@chobits

This comment has been minimized.

@chobits
Copy link
Member Author

chobits commented Mar 18, 2019

Test Case:

  • Tested-by: Xiaochen Wang xiaochen.wxc

  • Date: Mon Mar 18 20:54:03 CST 2019

  • pwd: /home/xiaochen.wxc/work/github/tengine-xiaochen

  • cases: modules/ngx_http_proxy_connect_module/t

  • git log:

commit 99690a7123c8e21818752fc6e89ae89795626484 (HEAD -> proxy_connect, origin/proxy_connect)
Author: Xiaochen Wang <wangxiaochen0@gmail.com>
Date:   Thu Mar 14 21:35:22 2019 +0800

    added new module: ngx_http_proxy_connect_module
  • case result:
$ TEST_NGINX_UNSAFE=yes TEST_NGINX_BINARY=/home/xiaochen.wxc/work/github/tengine-xiaochen/objs/nginx prove -v -I /home/xiaochen.wxc/work/github/tengine-xiaochen/tests/nginx-tests/nginx-tests/lib modules/ngx_http_proxy_connect_module/t
modules/ngx_http_proxy_connect_module/t/http_proxy_connect.t ..........
+ test_enable_rewrite_phase: 1
+ DNS server: try to bind server port: 18085
+ DNS server: daemon pid: 28187
+ DNS server: working
nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
ok 1 - 200 Connection Established
ok 2 - 200 Connection Established server name
ok 3 - 200 Connection Established server name
ok 4 - 200 Connection Established server name
ok 5 - 200 Connection Established not allowed port
ok 6 - Get method: proxy_pass
ok 7 - Get method: return 200
ok 8 - forbid CONNECT request without proxy_connect command enabled
ok 9 - set remote address
ok 10 - set local address and remote address
ok 11 - $connect_host, $connect_port, $connect_addr
ok 12 - dns resolver fail
nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
ok 13 - skip proxy connect module without rewrite phase enabled
ok 14 - skip proxy connect module without rewrite phase enabled: if/return
nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
ok 15 - 200 for default root directive without location {}
ok 16 - 404 for default root directive without location {}
+ DNS server: stop
1..16
ok 17 - no alerts
ok 18 - no sanitizer errors
All 16 subtests passed
modules/ngx_http_proxy_connect_module/t/http_proxy_connect_timeout.t ..
+ test_enable_rewrite_phase: 1
+ DNS server: try to bind server port: 18085
+ DNS server: daemon pid: 28209
+ DNS server: working
nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
ok 1 - connect timed out: set $var # TODO # This case will pass, if connecting 8.8.8.8 timed out.
ok 2 - connect timed out log: get $var & status=504 # TODO # This case will pass, if connecting 8.8.8.8 timed out.
ok 3 - connect timed out log: get $var
ok 4 - connect/send/read timed out log: get $var
+ DNS server: stop
1..4
ok 5 - no alerts
ok 6 - no sanitizer errors
All 4 subtests passed
        (2 TODO tests unexpectedly succeeded)

@chobits
Copy link
Member Author

chobits commented Mar 18, 2019

Updated tengine compatibility of ngx_http_proxy_connect_module , see https://github.com/chobits/ngx_http_proxy_connect_module#tengine-compatibility.

@wangfakang
Copy link
Collaborator

ACK.

@wangfakang wangfakang merged commit 5b276cd into alibaba:master Mar 19, 2019
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

Successfully merging this pull request may close these issues.

None yet

2 participants