hi,
最近有个需求,根据server name 动态选择http2.0 或http1.1
我修改了openresty代码,在ngx_http_lua_module.c中调用SSL_CTX_set_alpn_select_cb()覆盖了nginx的回调。在ngx.ssl添加了个函数set_http_version。
在ssl 握手的时候根据sni特性传递过来的server_name 修改http的版本。
具体修改见github:
https://github.com/vislee/lua-nginx-module/commit/e1ecd59ebf2fcfc6ecaaffe2a19678943e82357c
https://github.com/vislee/lua-resty-core/commit/c31d55193c240a21237b94ae4839b82f019d4ee0
不知道春哥有没有计划系统的支持该特性。或者官方有什么介意。谢谢!
hi, 最近有个需求,根据server name 动态选择http2.0 或http1.1 我修改了openresty代码,在ngx_http_lua_module.c中调用SSL_CTX_set_alpn_select_cb()覆盖了nginx的回调。在ngx.ssl添加了个函数set_http_version。 在ssl 握手的时候根据sni特性传递过来的server_name 修改http的版本。 具体修改见github: https://github.com/vislee/lua-nginx-module/commit/e1ecd59ebf2fcfc6ecaaffe2a19678943e82357c https://github.com/vislee/lua-resty-core/commit/c31d55193c240a21237b94ae4839b82f019d4ee0 不知道春哥有没有计划系统的支持该特性。或者官方有什么介意。谢谢! --
Hello你可以直接提 PR 到 github 对应的仓库,github 上更加适合讨论这种 :)不过你这个目前还没有测试用例,而 test-nginx 目前还不能发起 http2 的请求所以,要加测试用例的话,需要先给 test-nginx 提补丁,还是有不少的工作量 :)2017-02-16 12:50 GMT+08:00 Vis Lee <lazyv...@gmail.com>: hi, 最近有个需求,根据server name 动态选择http2.0 或http1.1 我修改了openresty代码,在ngx_http_lua_module.c中调用SSL_CTX_set_alpn_select_cb()覆盖了nginx的回调。在ngx.ssl添加了个函数set_http_version。 在ssl 握手的时候根据sni特性传递过来的server_name 修改http的版本。 具体修改见github: https://github.com/vislee/lua-nginx-module/commit/e1ecd59ebf2fcfc6ecaaffe2a19678943e82357c https://github.com/vislee/lua-resty-core/commit/c31d55193c240a21237b94ae4839b82f019d4ee0 不知道春哥有没有计划系统的支持该特性。或者官方有什么介意。谢谢! --
Hellotest-nginx 是不是可以check error log?回头我看下test-nginx 试着写个测试用例。多谢doujiang。在 2017年2月17日星期五 UTC+8上午10:14:39,doujiang写道:Hello你可以直接提 PR 到 github 对应的仓库,github 上更加适合讨论这种 :)不过你这个目前还没有测试用例,而 test-nginx 目前还不能发起 http2 的请求所以,要加测试用例的话,需要先给 test-nginx 提补丁,还是有不少的工作量 :)2017-02-16 12:50 GMT+08:00 Vis Lee <lazyv...@gmail.com>: hi, 最近有个需求,根据server name 动态选择http2.0 或http1.1 我修改了openresty代码,在ngx_http_lua_module.c中调用SSL_CTX_set_alpn_select_cb()覆盖了nginx的回调。在ngx.ssl添加了个函数set_http_version。 在ssl 握手的时候根据sni特性传递过来的server_name 修改http的版本。 具体修改见github: https://github.com/vislee/lua-nginx-module/commit/e1ecd59ebf2fcfc6ecaaffe2a19678943e82357c https://github.com/vislee/lua-resty-core/commit/c31d55193c240a21237b94ae4839b82f019d4ee0 不知道春哥有没有计划系统的支持该特性。或者官方有什么介意。谢谢! -- --