<commit_before>SPDY Proxy
==========

Reference implementation in [Go](http://golang.org/) of a proxy server for (semi-)permanently connected back-end servers, supporting SPDY and HTTPS.

Thanks to <NAME>, <NAME> and <NAME> for their help and contributions to how this proxy server idea and implementation.

This project is an extracion from a larger Amahi project and Jamie did this code based on a description of how the Amahi project was architected. It uses Jamie's excellent [SlyMarbo/spdy](https://github.com/SlyMarbo/spdy/) SPDY library.

Intro
=====

This is a proxy server process P and a back-end client for it C.

The proxy P serves (on two ports) a client (front-end) API to , called H.

The C (server) is a client that connects to P semi-permanently. Once it's connected, H calls are proxy'd to C, with TLS and SPDY, with C becoming a server for H. 

Once H ends the connection, C's SPDY connection is kept and reused for any other calls with H. Each call from H is funnelled to C via a SPDY stream.

	H	Proxy clients
	^
	|
	v
	P	Proxy
	^
	|
	v
	C	Client device that semi-permanently connect to P, then become Servers for H

Both the server to H and the interface with C support SPDY.

(C) 2013, Amahi
<commit_msg>Add testing section to the README<commit_after>SPDY Proxy
==========

Reference implementation in [Go](http://golang.org/) of a proxy server for (semi-)permanently connected back-end servers, supporting SPDY and HTTPS.

Thanks to <NAME>, <NAME> and <NAME> for their help and contributions to how this proxy server idea and implementation.

This project is an extracion from a larger Amahi project and Jamie did this code based on a description of how the Amahi project was architected. It uses Jamie's excellent [SlyMarbo/spdy](https://github.com/SlyMarbo/spdy/) SPDY library.

Intro
=====

This is a proxy server process P and a back-end client for it C.

The proxy P serves (on two ports) a client (front-end) API to , called H.

The C (server) is a client that connects to P semi-permanently. Once it's connected, H calls are proxy'd to C, with TLS and SPDY, with C becoming a server for H. 

Once H ends the connection, C's SPDY connection is kept and reused for any other calls with H. Each call from H is funnelled to C via a SPDY stream.

	H	Proxy clients
	^
	|
	v
	P	Proxy
	^
	|
	v
	C	Client device that semi-permanently connect to P, then become Servers for H

Both the server to H and the interface with C support SPDY.

Testing
=======

To test, run, e.g. in two separate windows, the client and the server:

    $ ./bin/p
    
    $ ./bin/c
    
You should see messages that they are connected. Then, in a third window, run the tests:

    $ cd integration-tests
    $ make
    Testing test-01-basic-root-dir-listing.sh
    PASS
    Testing test-02-image.sh
    PASS
    Testing test-03-video-avi.sh
    PASS
    Testing test-04-video-mkv.sh
    PASS
    Testing test-05-video-mp4.sh
    PASS
    
To add tests, see how these are added and follow the pattern. For control flow and concurrency tests, there may be more complex things that need to be done, for example using expect, killing connections, simultaneously starting connections, etc.

(C) 2013, Amahi

{'fraction_non_alphanumeric': 0.0734375, 'fraction_numerical': 0.0059375, 'mean_word_length': 3.4957865168539324, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7089542', 'n_tokens_mistral': 995, 'n_tokens_neox': 935, 'n_words': 486}