USING: io io.servers.connection calendar calendar.format ; IN: transparent-proxy ! TUPLE: conn in out log host ! "conn_%03d.txt" ascii ! Pseudo-code: ! accept connections on localhost:8080 ! for each connection, open logfile (%03d), read HTTP header, find server ! connect to server ! for each line, forward to server, forward to logfile ! close all ! TODO : proxy-handler ( -- ) now timestamp>rfc822 print ; : server-config ( -- threaded-server ) : new-proxy-server ( -- threaded-server ) "proxy-server" >>name 8080 local-server >>insecure \ proxy-handler >>handler ; ! Usage: start server, redirect dport:80 from eth1 to localhost:8080, connect via eth0 MAIN: new-proxy-server start-server ;