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

Port listening / IP interface #44

Open
spyjo opened this issue Sep 16, 2018 · 9 comments
Open

Port listening / IP interface #44

spyjo opened this issue Sep 16, 2018 · 9 comments
Labels
enhancement good first issue Easy fix for people who want to start contributing to the repository

Comments

@spyjo
Copy link

spyjo commented Sep 16, 2018

Hello,

I have installed joal on my dedicated server, and I have some suggests:

  • "Listening for incoming peer connections on port XXXX" => since I have a firewall on my server, it would be great to be able to choose this port manually in the configuration file, so I can open it in the firewall.

  • "Fetching ip from: http://ident.me/" , "Successfully fetch public IP address: XXXXX", "Ip reported to tracker will be XXXXX" => I have multiple IP addresses on my server, and in my case for my real Transmission server I have fixed one specific IP address. It would be great to be able to specify also the same IP address in joal configuration file, so others ips are not connected with torrents, and the seed would come from the same IP than the real client.

Thank you for your work :)

@anthonyraymond
Copy link
Owner

Ok, this shouldn't be too hard to implement. I'll do it asap, but i'm pretty busy these days.

@anthonyraymond anthonyraymond added enhancement good first issue Easy fix for people who want to start contributing to the repository labels Sep 17, 2018
@anthonyraymond
Copy link
Owner

Hi @spyjo

Just to make it clear what you want.

For the second point, you want to force using a specific network interface or you want to mock the ip address?
Not sure why you would like to use a second network interface (unless you have two different internet access point with different public ips). And mocking the ip adress won't make the trick since the tcp packets will still contains your real IP (which will be different from the mocked one).

@spyjo
Copy link
Author

spyjo commented Nov 9, 2018

Yes choosing a specific network interface which have an other IP address, not faking the IP.
On my dedicated server, I have multiple public IP addresses, one on eht0, an other on eth0:1, etc..

@anthonyraymond
Copy link
Owner

I can force the listening port, but i wont be able to force the network interface, there are no way to do such things on java.
But you can probably do that on the operating system level. There is a windows software to do that. There is probably a way to achieve this on linux as well

@spyjo
Copy link
Author

spyjo commented Nov 11, 2018

in fetchIp() in ConnectionHandler.java, may be you can use an "force public IP" option to force a choosen ip instead of using the IP returned by one of the provider ? Since it seems that the IP returned by this function is used to be reported to the torrent tracker

@anthonyraymond
Copy link
Owner

Yeah this is definely possible, but i believe this does not makes sense.
I can force http request to include a fake IP address in the request parameter ip (note that not all client sends this parameter, and most of the times trackers ignore it anyway). But i can't spoof your IP address in TCP/UDP packets, nor i can force java to root his traffic though a specific network interace. This is something that has to be done on the os level.

Plus such a feature will be confusing for users, if you can choose a specific IP you'd expect it to be the ip address that will appear on the tracker, and this is not the case.

@spyjo
Copy link
Author

spyjo commented Nov 24, 2018

nor i can force java to root his traffic though a specific network interace

It's doable almost everywhere, I would be surprised if Java doesn't have this option too.
For a listening daemon, you can bind to a specific IP address.
For remote connections, there must be some option to force the socket to connect from a specific source.

@anthonyraymond
Copy link
Owner

anthonyraymond commented Nov 24, 2018

Some ways may exists if i would like to try digging in the code for every http, tcp and udp request that the program will ever made. And with the condition that every library that i use to do such request allow me to change the network interface. Such things are error prone for future development.
This is way too much if for such a feature. Which can most likely be solved at the os level in a more elegant way (IMHO).

If you were needing to filter the water coming to your home, would you be add a filter on each tap or a single one at the main pipe?

https://stackoverflow.com/questions/49989230/setting-jvm-local-network-interface

@deadpansociety
Copy link

It'd be helpful to have customisable port number

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement good first issue Easy fix for people who want to start contributing to the repository
Projects
None yet
Development

No branches or pull requests

3 participants