You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To run the proxy, run docker-compose up. To be sure that you are using the latest version of the Dockerfile, you
can run docker-compose up --force-recreate --build
You can now visit the proxy by navigating to localhost:8080 in your browser. By default, the proxy will send a get
request to www.google.com
To navigate to a different url, use the url query parameter. For instance, if you wanted to visit Facebook, you
would visit localhost:8080/?url=http://www.facebook.com.
You can also add a range query parameter which will be sent as a header to the url you are trying to visit.
eg localhost:8080/?url=http://www.facebook.com&range=bytes:0-999
To get statistics on how long the proxy has been running and the number of bytes transferred, you can visit
localhost:8080/stats
Tests are in tests.py. You can run them by first running pip install -r requirements.txt and then pytest tests.py
Code coverage is available in the htmlcov folder. Open proxy_server_py.html to see coverage of the proxy_server.py
file. This was generated by the coverage.py library (not included in requirements.txt)
Limitations
The proxy only handles get requests as of now.
The stats available at /stats are only for the current run of the proxy. It could be improved so that stats persist
even after the proxy has been brought down and then back up again.
Due to some aiohttp limitations, some headers have to be removed from the request and the response unfortunately.
The tests display some warnings when they are run. This is because a return value is mocked out and a certain method
cannot be called on it. These can be ignored, though ideally the tests should not display warnings.