Skip to content

utkarshdalal/async_proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AsyncProxy

Instructions

  1. 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
  2. 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
  3. 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.
  4. 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
  5. To get statistics on how long the proxy has been running and the number of bytes transferred, you can visit localhost:8080/stats
  6. Tests are in tests.py. You can run them by first running pip install -r requirements.txt and then pytest tests.py
  7. 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

  1. The proxy only handles get requests as of now.
  2. 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.
  3. Due to some aiohttp limitations, some headers have to be removed from the request and the response unfortunately.
  4. 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors