caterpillar/README.md

58 lines
1.9 KiB
Markdown
Raw Normal View History

2024-02-19 04:41:01 +00:00
# gnh1201/caterpillar
Caterpillar - The simple and parasitic web debugging proxy
2022-10-05 17:19:11 +00:00
## How to works
```
2024-02-19 04:41:01 +00:00
You <-> Web proxy client (Python) <-> Server-side scripting file (Optional, e.g. PHP) <-> On the Web
2022-10-05 17:19:11 +00:00
```
2024-02-19 04:41:01 +00:00
Build a simple web debugging proxy on the shared servers!
2022-10-05 17:22:13 +00:00
2024-02-19 04:41:01 +00:00
## Before to use
2024-02-19 04:49:03 +00:00
If you have an ***will be parasitize*** server that you want to proxy, you can install the `index.php` file.
2022-10-07 17:19:19 +00:00
2024-02-19 04:41:01 +00:00
## How to use
1. Write a file `.env`(Linux) or `settings.ini`(Windows). Like this:
2022-10-07 17:19:19 +00:00
```
[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
2024-02-17 19:34:50 +00:00
LOCAL_DOMAIN=example.org
PROXY_PASS=http://127.0.0.1:3000
2024-02-18 08:17:07 +00:00
USER_TOKEN=
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:24:06 +00:00
1. In `[php-httpproxy installed directory]/settings.ini` or `.env`, set `SERVER_URL` variable to `localhost` in `.env` (e.g. `SERVER_URL=localhost`)
2. In `[mastodon installed directory]/env.production`, set `http_proxy` variable to `http://localhost:5555` (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
2024-02-17 09:14:45 +00:00
* ActivityPub [@gnh1201@catswords.social](https://catswords.social/@gnh1201)
2022-11-25 14:05:24 +00:00
* abuse@catswords.net