-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
534 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
# Created by .ignore support plugin (hsz.mobi) | ||
### Python template | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
cover/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
.pybuilder/ | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
# For a library or package, you might want to ignore these files since the code is | ||
# intended to run in multiple environments; otherwise, check them in: | ||
# .python-version | ||
|
||
# pipenv | ||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
# However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
# having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
# install all needed dependencies. | ||
#Pipfile.lock | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# pytype static type analyzer | ||
.pytype/ | ||
|
||
# Cython debug symbols | ||
cython_debug/ | ||
|
||
.idea | ||
start_squid.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
## Squid Ipv6 Proxies | ||
|
||
I made private ipv6 proxies for you. Use squid software. Translate ipv4 port to ipv6. Each port to one ipv6 outgoing | ||
|
||
## Features | ||
|
||
* Single IP for each /64 subnet | ||
* No Ipv4 leakage | ||
* Anonymous, Elite, Transparent | ||
* User/pass Authentication | ||
|
||
## Requirements | ||
- Python >= 3.6 | ||
- Squid v3 | ||
## Install | ||
|
||
- `ubuntu_install.sh` This bash script used to rebuild squid. Default squid installs via the `apt` limit to 128 port. To make more proxies in squid, We need an increasing number of squid ports for proxy. Here, I change the number port listen to 65000 | ||
- `gen_squid.py`. This python script used to gen squid config | ||
|
||
### Step 1 | ||
|
||
Run bash script | ||
|
||
```bash | ||
bash ubuntu_install.sh | ||
``` | ||
|
||
This script will install dependency and clone this repo to /opt. | ||
|
||
### Step 2 | ||
Gen Squid Config | ||
|
||
To see usage: | ||
|
||
``` | ||
PYTHONPATH=/opt/v6proxies python3.6 gen_squid.py --help | ||
``` | ||
|
||
Output | ||
|
||
``` | ||
usage: gen_squid.py [-h] --ipv6_subnet_full IPV6_SUBNET_FULL --net_interface NET_INTERFACE --pool_name POOL_NAME [--username USERNAME] [--password PASSWORD] [--number_ipv6 NUMBER_IPV6] [--unique_ip UNIQUE_IP] | ||
[--start_port START_PORT] | ||
Gen Squid Config | ||
optional arguments: | ||
-h, --help show this help message and exit | ||
--ipv6_subnet_full IPV6_SUBNET_FULL | ||
ipv6 subnet full | ||
--net_interface NET_INTERFACE | ||
net interface | ||
--pool_name POOL_NAME | ||
pool name | ||
--username USERNAME username | ||
--password PASSWORD password | ||
--number_ipv6 NUMBER_IPV6 | ||
number ipv6. Default = 250 | ||
--unique_ip UNIQUE_IP | ||
single ip for each /64 subnet. Default = 1 | ||
--start_port START_PORT | ||
start proxy port. Default 32000 | ||
``` | ||
|
||
For example. I have ipv6 subnet `2602:fed2:699b::/48` and I want to make `2000` proxies with start ipv4 port from `10000`, `each proxy on /64` | ||
|
||
```shell script | ||
PYTHONPATH=/opt/v6proxies python3.6 --ipv6_subnet_full 2602:fed2:699b::/48 --net_interface eth0 --pool_name squidv6 --number_ipv6 2000 --unique_ip 1 --start_port 10000 | ||
``` | ||
This script makes one squid config in /etc/squid with a filename like : `squid-squidv6.conf` and auth config file `squidv6.auth` | ||
|
||
And one .sh like `add_ip_{pool_name}.sh` in /opt/v6proxies. In this example. file name is `add_ip_squidv6.sh` | ||
|
||
`add_ip_{pool_name}.sh` is bash script to add ipv6 to network interface | ||
|
||
To start proxies. | ||
|
||
run two command | ||
|
||
```shell script | ||
bash /opt/v6proxies/add_ip_squidv6.sh | ||
``` | ||
|
||
```shell script | ||
/usr/local/squid/sbin/squid -f /etc/squid/squid-squidv6.conf | ||
``` | ||
|
||
### Testing | ||
|
||
```shell script | ||
curl -x https://{user_name}:{password}@{IP}:{Port} https://ident.me | ||
``` | ||
|
||
example | ||
|
||
``` | ||
curl -x https://cloud:[email protected]:10000 https://ident.me | ||
``` | ||
|
||
|
||
|
Oops, something went wrong.