Friday 22 November 2013

TLS / Http CONNECT handling for proxies

Some brief notes on behaviour.

General Theory
RFC for upgrading HTTP to TLS (Specifically section 5.2)
  http://www.ietf.org/rfc/rfc2817.txt
IEFT draft spec
  http://tools.ietf.org/html/draft-luotonen-web-proxy-tunneling-01

Basic steps (Using sockets / threads):
1) received 'CONNECT host:port HTTP/1.1
2) Open socket to host:port
3) If successful send back a 'HTTP/1.1 Connection Established\n\n" response
4) connect streams of client / and terminal host:port (pass bytes freely between client / server)

Todo:

  • Using SocketChannels / Selectors for non-blocking I/O
  • Testing
    • Performance
    • Unit-testing


Application / Domain specific
nodejs impl and discussion:
  https://groups.google.com/forum/#!topic/nodejs/KDAW_xEwTEg
nodejs and connect:
  https://groups.google.com/forum/#!search/http$20connect/nodejs/MGeOheQQF28/T2VmEjjbn-0J