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
# HTTP Reverse proxy server | |
# Original Source: http://rubyforge.org/snippet/download.php?type=snippet&id=162 | |
# Use case: you have several services running as different users | |
# for security purposes (they might even be chrooted). | |
# In production we use apache but for testing I prefer to use | |
# webrick because I find it more flexible for unit testing. | |
# The proxy mapping is modelled on the ProxyPass directive | |
# of apache. For example: | |
# |
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
require 'fiddle' | |
require 'socket' | |
libssl = Fiddle.dlopen('/usr/lib/libssl.so') | |
ssl_init = Fiddle::Function.new(libssl['SSL_library_init'],[],Fiddle::TYPE_INT) | |
ssl_load_error = Fiddle::Function.new(libssl['SSL_load_error_strings'],[],Fiddle::TYPE_INT) | |
ssl_client_method = Fiddle::Function.new(libssl['SSLv3_client_method'],[],Fiddle::TYPE_LONG) | |
ssl_ctx = Fiddle::Function.new(libssl['SSL_CTX_new'],[Fiddle::TYPE_LONG],Fiddle::TYPE_LONG) | |
ssl_ctx_reneg = Fiddle::Function.new(libssl['SSL_CTX_sess_connect_renegotiate'],[Fiddle::TYPE_LONG],Fiddle::TYPE_LONG) |