🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

SimpleHttpProxy

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

SimpleHttpProxy

This package implements a simple HTTP(S) proxy.

0.0.3
PyPI
Maintainers
1

SimpleHttpProxy logo

SimpleHttpProxy

Description

This package implements a simple and partially asynchronous HTTP(S) proxy.

Requirements

This package require:

  • python3
  • python3 Standard Library

Installation

Pip

python3 -m pip install SimpleHttpProxy

Git

git clone "https://github.com/mauricelambert/SimpleHttpProxy.git"
cd "SimpleHttpProxy"
python3 -m pip install .

Wget

wget https://github.com/mauricelambert/SimpleHttpProxy/archive/refs/heads/main.zip
unzip main.zip
cd SimpleHttpProxy-main
python3 -m pip install .

cURL

curl -O https://github.com/mauricelambert/SimpleHttpProxy/archive/refs/heads/main.zip
unzip main.zip
cd SimpleHttpProxy-main
python3 -m pip install .

Usages

Default proxy printer using command line

python3 SimpleHttpProxy.py -h
python3 ProxyPrinter.pyz --help

ProxyPrinter --interface 0.0.0.0 --port 8012 --unsecure
ProxyPrinter -i 0.0.0.0 -p 8012 -s

Custom proxy using Python

Proxy Server:

from SimpleHttpProxy import AbcHttpProxy

class ProxyRestrict(AbcHttpProxy):
	def handle_request(self, data: bytes) -> bytes:
		if b'://www.ruby-lang.org' in data.split(b"\r\n", 1)[0]:
			return data.replace(b'www.ruby-lang.org', b'www.python.org', 2)
		return data
	def handle_response(self, data: bytes) -> bytes:
		return data.replace(b'www.ruby-lang.org', b'www.python.org')

proxy = ProxyRestrict()
proxy.start()

Python Client:

from urllib.request import Request, urlopen
r = Request("http://ruby-lang.org/")
r.set_proxy('127.0.0.1:8012', 'http')
print(urlopen(r).read()[3150:4000].decode())

Screenshots

Firefox proxy configuration

Default: Proxy Printer

Custom: Proxy Restriction

  • Pypi
  • Github
  • Documentation
  • Executable
  • Python Windows executable

Licence

Licensed under the GPL, version 3.

Keywords

Proxy

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts