Skip to content

Instantly share code, notes, and snippets.

@fcamel
Created September 11, 2015 07:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fcamel/1ec37365850abd13b081 to your computer and use it in GitHub Desktop.
Save fcamel/1ec37365850abd13b081 to your computer and use it in GitHub Desktop.
Backup of SPDY Proxy Examples
Source: http://www.chromium.org/spdy/spdy-proxy-examples
Client HTTPS Proxy Origin Server
------ ----------- -------------
*** If an available connection to the proxy exists, jump to step 9 ***
*** Client opens TCP connection to Proxy ***
|---------------------->| |
| 1) SYN | |
| | |
|<----------------------| |
| 2) SYN_ACK | |
| | |
|---------------------->| |
| 3) ACK | |
| | |
*** Client performs SSL handshake with Proxy ***
|---------------------->| |
| 4) Client Hello | |
| | |
|<----------------------| |
| 5) Server Hello | |
| | |
|---------------------->| |
| 6) Client Key Exchange| |
| | |
|---------------------->| |
| 7) Client Finished | |
| | |
|<----------------------| |
| 8) Server Finished | |
| | |
*** Client requests url ***
---------------------->| |
|9) GET http://origin/ | |
| | |
| *** Proxy connects (or reuses connection) to origin ***
| |--------------------->|
| |10) SYN |
| | |
| |<---------------------|
| |11) SYN_ACK |
| | |
| |--------------------->|
| |12) ACK |
| | |
| *** Proxy issues request via HTTP to backend ***
| |--------------------->|
| |13) GET http://origin/ HTTP/1.1
| | |
| | |
| *** Origin sends HTTP response to Proxy ***
| |<---------------------|
| |14) HTTP/1.1 200 OK |
| | |
*** Proxy reads HTTP response from backend sends HTTP response to client ***
|<----------------------| |
|13) HTTP/1.1 200 OK | |
| | |
Client HTTPS Proxy Origin Server
------ ----------- -------------
*** If an available tunnel to the origin exists, jump to step 19 ***
*** If an available connection to the proxy exists, jump to step 9 ***
*** Client opens TCP connection to Proxy ***
|---------------------->| |
| 1) SYN | |
| | |
|<----------------------| |
| 2) SYN_ACK | |
| | |
|---------------------->| |
| 3) ACK | |
| | |
*** Client performs SSL handshake with Proxy ***
|---------------------->| |
| 4) Client Hello | |
| | |
|<----------------------| |
| 5) Server Hello | |
| | |
|---------------------->| |
| 6) Client Key Exchange| |
| | |
|---------------------->| |
| 7) Client Finished | |
| | |
|<----------------------| |
| 8) Server Finished | |
| | |
*** Client sends CONNECT request to Proxy via SPDY ***
---------------------->| |
|9) CONNECT origin:443 | |
| | |
| *** Proxy connects (or reuses connection) to origin ***
| |--------------------->|
| |10) SYN |
| | |
| |<---------------------|
| |11) SYN_ACK |
| | |
| |--------------------->|
| |12) ACK |
| | |
*** Proxy sends HTTP CONNECT response to client ***
|<----------------------| |
|13) HTTP/1.1 200 Connection Established |
| | |
*** Client performs SSL handshake with Origin (through proxy tunnel) ***
|=============================================>|
|14) Client Hello |
| |
|<=============================================|
|15) Server Hello |
| |
|=============================================>|
|16) Client Key Exchange |
| |
|=============================================>|
|17) Client Finished |
| |
|<=============================================|
|18) Server Finished |
| |
*** Client issues request via HTTP to origin ***
|=============================================>|
|19) GET / HTTP/1.1 |
| Host: origin |
| |
|*** Origin sends HTTP response to Client ***
|<=============================================|
|20) HTTP/1.1 200 OK |
| |
Client HTTPS Proxy Origin Server
------ ----------- -------------
*** If an available tunnel to the origin exists, jump to step 19 ***
*** If an available connection to the proxy exists, jump to step 9 ***
*** Client opens TCP connection to Proxy ***
|---------------------->| |
| 1) SYN | |
| | |
|<----------------------| |
| 2) SYN_ACK | |
| | |
|---------------------->| |
| 3) ACK | |
| | |
*** Client performs SSL handshake with Proxy ***
|---------------------->| |
| 4) Client Hello | |
| | |
|<----------------------| |
| 5) Server Hello | |
| | |
|---------------------->| |
| 6) Client Key Exchange| |
| | |
|---------------------->| |
| 7) Client Finished | |
| | |
|<----------------------| |
| 8) Server Finished | |
| | |
*** Client sends CONNECT request to Proxy via SPDY ***
---------------------->| |
|9) CONNECT origin:443 | |
| | |
| *** Proxy connects (or reuses connection) to origin ***
| |--------------------->|
| |10) SYN |
| | |
| |<---------------------|
| |11) SYN_ACK |
| | |
| |--------------------->|
| |12) ACK |
| | |
*** Proxy sends HTTP CONNECT response to client ***
|<----------------------| |
|13) HTTP/1.1 200 Connection Established |
| | |
*** Client performs SSL handshake with Origin (through proxy tunnel) ***
|=============================================>|
|14) Client Hello |
| |
|<=============================================|
|15) Server Hello |
| |
|=============================================>|
|16) Client Key Exchange |
| |
|=============================================>|
|17) Client Finished |
| |
|<=============================================|
|18) Server Finished |
| |
*** Client issues request via SPDY to origin ***
|=============================================>|
|19)SYN_STREAM |
| stream_id = 1 |
| method = GET |
| url = / |
| host = origin |
| |
|*** Origin sends SPDY response to Client ***
|<=============================================|
|20)SYN_REPLY |
| stream_id = 1 |
| status = 200 OK |
| |
Client HTTPS Proxy Origin Server
------ ----------- -------------
*** If an available connection to the proxy exists, jump to step 9 ***
*** Client opens TCP connection to Proxy ***
|---------------------->| |
| 1) SYN | |
| | |
|<----------------------| |
| 2) SYN_ACK | |
| | |
|---------------------->| |
| 3) ACK | |
| | |
*** Client performs SSL handshake with Proxy ***
|---------------------->| |
| 4) Client Hello | |
| | |
|<----------------------| |
| 5) Server Hello | |
| | |
|---------------------->| |
| 6) Client Key Exchange| |
| | |
|---------------------->| |
| 7) Client Finished | |
| | |
|<----------------------| |
| 8) Server Finished | |
| | |
*** Client requests urls over SPDY *** |
---------------------->| |
|9) SYN_STREAM | |
| stream_id = 1 | |
| method = GET | |
| url = http://origin/| |
| | |
| *** Proxy connects (or reuses connection) to origin ***
| |--------------------->|
| |10) SYN |
| | |
| |<---------------------|
| |11) SYN_ACK |
| | |
| |--------------------->|
| |12) ACK |
| | |
| *** Proxy issues request via HTTP to backend ***
| |--------------------->|
| |13) GET http://origin/ HTTP/1.1
| | |
| | |
| *** Origin sends HTTP response to Proxy ***
| |<---------------------|
| |14) HTTP/1.1 200 |
| | |
*** Proxy reads HTTP response from backend sends SPDY response to client ***
|<----------------------| |
| 15) SYN_REPLY | |
| stream_id = 1 | |
| status = 200 OK | |
| | |
Client HTTPS Proxy Origin Server
------ ----------- -------------
*** If an available tunnel to the origin exists, jump to step 19 ***
*** If an available connection to the proxy exists, jump to step 9 ***
*** Client opens TCP connection to Proxy ***
|---------------------->| |
| 1) SYN | |
| | |
|<----------------------| |
| 2) SYN_ACK | |
| | |
|---------------------->| |
| 3) ACK | |
| | |
*** Client performs SSL handshake with Proxy ***
|---------------------->| |
| 4) Client Hello | |
| | |
|<----------------------| |
| 5) Server Hello | |
| | |
|---------------------->| |
| 6) Client Key Exchange| |
| | |
|---------------------->| |
| 7) Client Finished | |
| | |
|<----------------------| |
| 8) Server Finished | |
| | |
*** Client sends CONNECT request to Proxy via SPDY ***
---------------------->| |
| 9)SYN_STREAM | |
| stream_id = 1 | |
| method = CONNECT | |
| url = origin:443 | |
| | |
| *** Proxy connects (or reuses connection) to origin ***
| |--------------------->|
| |10) SYN |
| | |
| |<---------------------|
| |11) SYN_ACK |
| | |
| |--------------------->|
| |12) ACK |
| | |
*** Proxy sends SPDY CONNECT response to client ***
|<----------------------| |
|13)SYN_REPLY | |
| stream_id = 1 | |
| status = 200 Connection Established |
| | |
*** Client performs SSL handshake with Origin (through proxy tunnel) ***
|=============================================>|
|14) Client Hello |
| |
|<=============================================|
|15) Server Hello |
| |
|=============================================>|
|16) Client Key Exchange |
| |
|=============================================>|
|17) Client Finished |
| |
|<=============================================|
|18) Server Finished |
| |
*** Client issues request via HTTP to origin ***
|=============================================>|
|19) GET / HTTP/1.1 |
| Host: origin |
| |
|*** Origin sends HTTP response to Client ***
|<=============================================|
|20) HTTP/1.1 200 OK |
| |
Client HTTPS Proxy Origin Server
------ ----------- -------------
*** If an available tunnel to the origin exists, jump to step 19 ***
*** If an available connection to the proxy exists, jump to step 9 ***
*** Client opens TCP connection to Proxy ***
|---------------------->| |
| 1) SYN | |
| | |
|<----------------------| |
| 2) SYN_ACK | |
| | |
|---------------------->| |
| 3) ACK | |
| | |
*** Client performs SSL handshake with Proxy ***
|---------------------->| |
| 4) Client Hello | |
| | |
|<----------------------| |
| 5) Server Hello | |
| | |
|---------------------->| |
| 6) Client Key Exchange| |
| | |
|---------------------->| |
| 7) Client Finished | |
| | |
|<----------------------| |
| 8) Server Finished | |
| | |
*** Client sends CONNECT request to Proxy via SPDY ***
---------------------->| |
| 9)SYN_STREAM | |
| stream_id = 1 | |
| method = CONNECT | |
| url = origin:443 | |
| | |
| *** Proxy connects (or reuses connection) to origin ***
| |--------------------->|
| |10) SYN |
| | |
| |<---------------------|
| |11) SYN_ACK |
| | |
| |--------------------->|
| |12) ACK |
| | |
*** Proxy sends SPDY CONNECT response to client ***
|<----------------------| |
|13)SYN_REPLY | |
| stream_id = 1 | |
| status = 200 Connection Established |
| | |
*** Client performs SSL handshake with Origin (through proxy tunnel) ***
|=============================================>|
|14) Client Hello |
| |
|<=============================================|
|15) Server Hello |
| |
|=============================================>|
|16) Client Key Exchange |
| |
|=============================================>|
|17) Client Finished |
| |
|<=============================================|
|18) Server Finished |
| |
*** Client issues request via SPDY to origin ***
|=============================================>|
|19)SYN_STREAM |
| stream_id = 1 |
| method = GET |
| url = / |
| host = origin |
| |
|*** Origin sends SPDY response to Client ***
|<=============================================|
|20)SYN_REPLY |
| stream_id = 1 |
| status = 200 Connection Established |
| |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment