Sign inSign up

austinjung/async-http-proxy-python

By austinjung

•Updated over 9 years ago

AsyncProxy - Python Programming Task : build an asynchronous HTTP proxy

Image
0

1.1K

austinjung/async-http-proxy-python repository overview

⁠AsyncProxy - Python Programming Task

Your task is to build an asynchronous HTTP proxy (see definition in RFC2616⁠) complying to the requirements specified below.

⁠Requirements

  1. Range requests must be supported as defined in RFC2616⁠, but also via range query parameter.

  2. HTTP 416 error must be returned in case where both header and query parameter are specified, but with a different value.

  3. Program must start with a single command docker-compose up.

  4. Proxy must be reachable at http://<docker-host>:8080 .

  5. Usage statistics must be available at http://<docker-host>:8080/stats

  • total bytes transferred
  • uptime
  1. Code must run with Python 3.5+.

  2. Code must be delivered as a link to public GitHub repository.

⁠Design

  1. I built a simple AsyncProxy server based on aiohttp⁠. The reasons are:
  2. The default proxy target server is set to http://youtube.com⁠

⁠Deployment

  1. This project repository is https://bitbucket.org/austinjung/asyncproxyinpython⁠
  2. The project repository is linked with Austin's Docker Cloud⁠
  3. In your docker, run the following line.
    $ docker run -p 8080:8080 austinjung/async-http-proxy-python:latest
    
    or
    clone the project repository
    cd /to/the_top_folder_of_the_project
    $ docker-compose up
    

⁠Things do-to

  1. Some images or contents are blocked by 'Referrer Policy: no-referrer-when-downgrade', 'Access-Control-Allow_Origin', or 'cross-origin frame' etc.
  2. Do proper post method. and more

Tag summary

Content type

Image

Digest

Size

262.3 MB

Last updated

over 9 years ago

docker pull austinjung/async-http-proxy-python