caterpillar/README.md

52 lines
1.6 KiB
Markdown
Raw Normal View History

2022-10-05 17:16:30 +00:00
# php-httpproxy
2024-02-17 09:12:18 +00:00
HTTP(S) proxy implementation with PHP (PHP is no required) socket
2022-10-05 17:19:11 +00:00
## How to works
```
2022-11-25 12:58:03 +00:00
You <-----> HTTP(S) proxy (Python) <-----> Web hosting (PHP) <-----> On the Web
2022-10-05 17:19:11 +00:00
```
2022-11-25 13:57:49 +00:00
HTTP(S) proxy over the web hosting!
2022-10-05 17:22:13 +00:00
2022-10-07 17:19:19 +00:00
## How to use
1. Write a file with filename like `.env`(Linux) or `settings.ini`(Windows). Like this:
```
[settings]
PORT=5555
2022-11-25 08:12:58 +00:00
SERVER_URL=http://example.org
CA_KEY=ca.key
CA_CERT=ca.crt
CERT_KEY=cert.key
CERT_DIR=certs/
2022-11-25 12:58:03 +00:00
OPENSSL_BINPATH=openssl
2022-11-25 12:35:02 +00:00
CLIENT_ENCODING=utf-8
2022-10-07 17:19:19 +00:00
```
2024-02-17 09:01:59 +00:00
1.1. (Optional) Install ca.cert
```bash
2024-02-17 09:04:50 +00:00
sudo apt-get install -y ca-certificates
sudo cp ca.crt /usr/local/share/ca-certificates/php-httpproxy-ca.crt
sudo update-ca-certificates
2024-02-17 09:01:59 +00:00
```
2024-02-17 09:04:50 +00:00
2. Run `python3 server.py` and set HTTP(S) proxy in your web browser (e.g. Firefox)
2022-10-07 17:19:19 +00:00
2022-11-25 13:11:55 +00:00
3. Test [100MB](http://speed.hetzner.de/100MB.bin)/[SSL](https://speed.hetzner.de/100MB.bin), [1GB](http://speed.hetzner.de/1GB.bin)/[SSL](https://speed.hetzner.de/1GB.bin), [10GB](http://speed.hetzner.de/10GB.bin)/[SSL](http://speed.hetzner.de/10GB.bin) download and check the speed (e.g. https://speed.hetzner.de/1GB.bin)
2022-10-07 17:32:53 +00:00
2022-10-07 17:19:19 +00:00
3. Enjoy it
2022-10-08 15:51:58 +00:00
4. (Optional) With [Cloudflare](https://cloudflare.com), we can expect to accelerate the 4x speed and reduce the network stuck.
2022-10-08 15:48:25 +00:00
2024-02-17 09:04:50 +00:00
## (Optional) For Mastodon users
2024-02-17 09:11:03 +00:00
1. set `SERVER_URL` variable to `localhost` in `.env` or `settings.ini` (e.g. `SERVER_URL=localhost`)
2. set `http_proxy` variable to `http://localhost:5555` in `env.production` (e.g. `http_proxy=http://localhost:5555`)
2024-02-17 09:04:50 +00:00
2022-10-05 17:21:12 +00:00
## References
* https://github.com/anapeksha/python-proxy-server
2022-11-25 14:05:24 +00:00
* https://github.com/inaz2/proxy2
2022-10-05 17:21:12 +00:00
2022-10-05 17:19:11 +00:00
## Contact
2022-11-25 14:05:24 +00:00
* abuse@catswords.net