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

[Feature Request] Local Mode (single country mode) #12

Open
As4pmq9 opened this issue Jul 22, 2023 · 9 comments
Open

[Feature Request] Local Mode (single country mode) #12

As4pmq9 opened this issue Jul 22, 2023 · 9 comments
Labels
enhancement New feature or request

Comments

@As4pmq9
Copy link

As4pmq9 commented Jul 22, 2023

The reason for this Feature Request is written in here.
#11

Though I am not a soft engineer, but I figure qtox will send request to all the root server all over the world(Please correct me if I was wrong).

And this behavior will be caught by the great fire wall of china(famous known as GFW), but GFW only detect request that toward out of china.

So I am hoping maybe qtox can choose to only connect root server which is only in one certain contry, if that country doesn't have ipv4 root server, then only connecting to local ipv6 server.

@gjedeer
Copy link

gjedeer commented Jul 24, 2023

Maybe you can enforce it with firejail? Its --join-network switch has the ability to run firewall rules just for this program:

https://www.man7.org/linux/man-pages/man1/Firejail.1.html

The list of IP addresses assigned to China is here - not sure how reliable:

https://github.com/17mon/china_ip_list/blob/master/china_ip_list.txt

If you need help feel free to email me.

@As4pmq9
Copy link
Author

As4pmq9 commented Jul 25, 2023

Thank you for the reply.
Maybe I can add those ip in windows firewall one by one

Is it possible to add a text box in setting which allow user to add those ip list, then qtox will only connect to the ip in list?

like this
Capture

@gjedeer
Copy link

gjedeer commented Jul 25, 2023

There isn't a GUI for this, but if you put a file named bootstrapNodes.json in your settings path (on Windows it's appdata/roaming/tox in your user directory), it will read the bootstrap nodes to connect to from that file. The format is like this: https://nodes.tox.chat/json - you can just save the file I linked and delete the nodes you don't want. Or just create your own file that looks like this.

I can't see any nodes located in China though.

Documentation is here

## Bootstrap Nodes

@As4pmq9
Copy link
Author

As4pmq9 commented Jul 26, 2023

Yeah, sadly
There is no nodes located in china, so if I block all the connection out of china, qtox will be offline forever

@gjedeer
Copy link

gjedeer commented Jul 26, 2023

If you know how to forward ports, you can run the node yourself. You don't have to make it public, just send bootstrapNodes.json to your friends.

@As4pmq9
Copy link
Author

As4pmq9 commented Jul 26, 2023

You mean like this?
{
"nodes": [
{
"ipv4": "my ip",
"ipv6": "my ip",
"maintainer": "xxx",
"port": random port,
"public_key": "randon key",
"status_tcp": true,
"status_udp": true,
"tcp_ports": [
random port2,
random port
]
}
]
}

Then I need to forward ports "random port2" and "random port", and send this file to my friend?

But there is a problem, in china, there is only one ISP give user public ip(expensive), and the public ip is also dynamic, ISP will change it about every 2 weeks.

@gjedeer
Copy link

gjedeer commented Jul 26, 2023

Yeah, except - and I just realized this now - you would need to run tox-bootstrapd as the relay and qTox just when you talk to people. And - I just searched - it doesn't look like there's a Windows .exe file to download anywhere. I didn't know that when I was making the suggestion - in Debian it's in the main repos.

The reason why you can't do it with qTox is because of the public key you need to give to your friend (in the JSON you wrote above) - with qTox it changes every time you run it, and tox-bootstrapd is built to always have the same public key.

With the dynamic IP, yeah, very similar where I live. If you have some money to spare you could get a cheapest VPS and run tox-bootstrapd there (or, if that doesn't end up working for you, you can just run an XMPP/matrix/mattermost/... server instead). But I'm not sure if you have any cheap VPS providers behind the GFW. I'm talking something like $1/month with 512 MB RAM, completely low end.

@As4pmq9
Copy link
Author

As4pmq9 commented Jul 27, 2023

Yeah, there is cheap VPS in china, thanks for the patience

@zoff99
Copy link

zoff99 commented Jul 29, 2023

@Tha14 can you help post the link to the tox bootstrap .exe for windows?
or to the repo for it?

@zoff99 zoff99 added the enhancement New feature or request label Jul 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

3 participants