Sha256: 52abb866a6a05950a91b766bd35ccbe261a0db5795732278f806db7a9c37bf1e
Contents?: true
Size: 640 Bytes
Versions: 5
Compression:
Stored size: 640 Bytes
Contents
require 'webrick/httpproxy' ProxyServer = WEBrick::HTTPProxyServer.new(:Port => 8080, :AccessLog => []) t = Thread.new { ProxyServer.start } trap("INT") { ProxyServer.shutdown; exit } AuthenticatedProxyServer = WEBrick::HTTPProxyServer.new(:Port => 8081, :ProxyAuthProc => Proc.new do | req, res | WEBrick::HTTPAuth.proxy_basic_auth(req, res, 'proxy') do | user, pass | user == 'username' and pass == 'password' end end) t = Thread.new { AuthenticatedProxyServer.start } trap("INT") { AuthenticatedProxyServer.shutdown; exit }
Version data entries
5 entries across 5 versions & 1 rubygems