[mod_wstunnel] websocket tunnel to other protocol

*experimental*

decodes websockets and passes body back and forth from backend
(body could be known protocol such as JSON, or any custom protocol)

originally based off https://github.com/nori0428/mod_websocket
personal/stbuehler/mod-csrf
Glenn Strauss 2017-07-25 02:08:15 -04:00
parent 889db409dc
commit 477534084a
5 changed files with 1360 additions and 1 deletions

View File

@ -1014,7 +1014,7 @@ AC_OUTPUT
do_build="mod_cgi mod_fastcgi mod_extforward mod_proxy mod_evhost mod_simple_vhost mod_access mod_alias mod_setenv mod_usertrack mod_auth mod_authn_file mod_status mod_accesslog"
do_build="$do_build mod_rrdtool mod_secdownload mod_expire mod_compress mod_dirlisting mod_indexfile mod_userdir mod_webdav mod_staticfile mod_scgi mod_flv_streaming mod_ssi mod_deflate"
do_build="$do_build mod_vhostdb"
do_build="$do_build mod_vhostdb mod_wstunnel"
plugins="mod_rewrite mod_redirect"
features="regex-conditionals"

View File

@ -635,6 +635,7 @@ add_and_install_library(mod_userdir mod_userdir.c)
add_and_install_library(mod_usertrack mod_usertrack.c)
add_and_install_library(mod_vhostdb mod_vhostdb.c)
add_and_install_library(mod_webdav mod_webdav.c)
add_and_install_library(mod_wstunnel mod_wstunnel.c)
add_executable(test_buffer
test_buffer.c
@ -822,6 +823,7 @@ if(HAVE_LIBSSL AND HAVE_LIBCRYPTO)
set(L_MOD_AUTHN_FILE ${L_MOD_AUTHN_FILE} crypto)
target_link_libraries(mod_authn_file ${L_MOD_AUTHN_FILE})
target_link_libraries(mod_secdownload crypto)
target_link_libraries(mod_wstunnel crypto)
endif()
if(WITH_LIBEV)

View File

@ -370,6 +370,11 @@ mod_uploadprogress_la_SOURCES = mod_uploadprogress.c
mod_uploadprogress_la_LDFLAGS = $(common_module_ldflags)
mod_uploadprogress_la_LIBADD = $(common_libadd)
lib_LTLIBRARIES += mod_wstunnel.la
mod_wstunnel_la_SOURCES = mod_wstunnel.c
mod_wstunnel_la_LDFLAGS = $(common_module_ldflags)
mod_wstunnel_la_LIBADD = $(common_libadd) $(CRYPTO_LIB)
hdr = server.h base64.h buffer.h network.h log.h keyvalue.h \
response.h request.h fastcgi.h chunk.h \

View File

@ -124,6 +124,7 @@ modules = {
'mod_ssi' : { 'src' : [ 'mod_ssi_exprparser.c', 'mod_ssi_expr.c', 'mod_ssi.c' ] },
'mod_flv_streaming' : { 'src' : [ 'mod_flv_streaming.c' ] },
'mod_vhostdb' : { 'src' : [ 'mod_vhostdb.c' ] },
'mod_wstunnel' : { 'src' : [ 'mod_wstunnel.c' ], 'lib' : [ env['LIBCRYPTO'] ] },
}
if env['with_geoip']:

1351
src/mod_wstunnel.c Normal file

File diff suppressed because it is too large Load Diff