Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any way to use this project with a fixed list of IPs? #25

Open
erickythierry opened this issue Apr 18, 2024 · 5 comments
Open
Labels
enhancement New feature or request

Comments

@erickythierry
Copy link

I have an Oracle VPS, but I can't associate an entire IPv6 block to it, I can only define multiple fixed IPs.
So my idea would be to associate a few dozen v6 ips in this vps, store them in a list and inject them into the project so that it rotates between them.

Would it be possible to do this?

If the script does not currently have this capability, could you tell me where in the script the IP that will be used is chosen? So I can try to modify the code for my specific use.

@HoroshoVse
Copy link

I support the proposal

@erickythierry
Copy link
Author

erickythierry commented Apr 24, 2024

I support the proposal

I ended up finding a solution after some time analyzing the code with the help of AI (claude)

As I saw that you showed interest in the idea I proposed, here is the solution I created. It's very manual but it worked for my purpose.

You just need to comment on this piece of code that starts on line 442 and ends on line 450:

# Temporary variable to count generated ip's in cycle
  # count=1

  # Generate random 'proxy_count' ipv6 of specified subnet and write it to 'ip.list' file
  # while [ "\$count" -le $proxy_count ]
  # do
  #   rnd_subnet_ip >> $random_ipv6_list_file;
  #   ((count+=1))
  # done;

and right after it you insert this command:

echo "your ipv6-1 here" >> $random_ipv6_list_file
echo "your ipv6-2 here" >> $random_ipv6_list_file
echo "your ipv6-3 here" >> $random_ipv6_list_file
echo "your ipv6-4 here" >> $random_ipv6_list_file
echo "your ipv6-N here" >> $random_ipv6_list_file

I put this command 8x with different IPs that I previously attached to my vps.

After that I ran the command described in readme.md

./ipv6-proxy-server.sh -u user -p pass -r 10 --disable-inet6-ifaces-check --proxies-type socks5 -c 2 --start-port 30000

So the script made the necessary settings and started 8 proxies with the 8 IP addresses that I defined previously
from port 30000 to port 30007

I did the necessary tests using the command:
curl --proxy socks5://user:pass@(my-ipv4):30000 http://ifconfig.me

just switching the port from 30000 to 30007 and it worked great, returning me different ips as my address

I will add dozens more IPv6 this way

I hope this serves your purpose too 😁

edit: if you want to add more ips later after having already started the script, just add more

echo "your ipv6" >> $random_ipv6_list_file
...

and then rerun the script, it will update the ips list

@erickythierry
Copy link
Author

I ended up making this fork with the modifications.
ipv6-multiple-proxy-server
I removed the cron function that rotated ips (since my focus is to use previously defined fixed ips)
I removed the part about deleting the interface ips, since this was removing the ips associated with the default interface.
I added a code that identifies which public IPv6s are available on the default interface and adds them to the list of ips ipv6.list
I defined that the default proxy is of the socks5 type (more useful for my scenario)

with this fork, several proxies will be started using all IPv6 available on the default interface
in my case I have 15 ips, so 15 proxies were created

@Temporalitas
Copy link
Owner

Interesting idea, maybe I'll add this feature. Reopen issue as a good enhancement.

@Temporalitas Temporalitas reopened this May 15, 2024
@Temporalitas Temporalitas added the enhancement New feature or request label May 15, 2024
@Temporalitas
Copy link
Owner

@erickythierry if you have a solution that doesn't break the rest of the functionality of the script (for example, an additional option for a fixed IP list), I'd be glad if you create a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants