-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
use standard, unassigned ports for the daemon #874
Comments
ports are already customizable. you can change them in the config. See: ipfs config Addresses.Gateway
ipfs config Addresses.API
ipfs config Addresses.Swarm
ipfs config Addresses they can be set like:
Agreed |
I agree that we should probably avoid 8080 |
if you don't mind, i created a PR for documenting the ports changing procedure in #879. we can therefore keep this ticket for changing the default ports to more standard behaviour. |
@anarcat on the ports, the reasoning for I dont care much about it, whatever works and is intuitive to people. |
I guess is also needed a change of the default port 5001, because port is used by iperf program by default... |
We had a related discussion recently (@batcer in #1678 (comment) and myself):
(..)
(..)
The gist: 8080 is very popular and often clashes with other software, using something else (in |
Yes, ok -- I think we should use something like:
Maybe Some port clashing will be inevitable, and configurability is fine. But One thing to note: lots of ipfs things today assume On Thursday, October 8, 2015, Marcin Rataj [email protected] wrote:
|
Get here while googling for a commplex-link (5001) conflict with ipfs daemon. So the problem is actual. |
@jbenet |
Is this still the case? |
Nothing has changed here, unfortunately. |
I also have Tomcat installed and I needed to change the default port. So I chose port 6437 for my ipfs gateway. How did I come to this idea? I converted the lowercase letters of ipfs to their decimal values and just added up the digits.
The fact that apparently this port is unasigned (according to speedguide.net) made me think it was a good alternative port. At least it's not a totally random number. |
Closing as something we'll have to re-evaluate for a 1.0 release. |
Somehow related: a proposal for ipfs-desktop (GUI wrapper for go-ipfs) to automatically pick a free port is discussed in ipfs/ipfs-desktop#912 |
My thinking is along these lines:
|
Why not change the IP instead of the port? We could just use 127.0.0.80:8080 or something like this :) |
That will work for IPv4, but not ipv6. |
Hm. Although I guess we don't even listen on IPv6 by default. |
Ah, nevermind. The issue is browsers. localhost -> 127.0.0.1 and "localhost" is treated as a secure origin, even without TLS. If we used a non-localhost address, HTTPS websites wouldn't be able to make requests to the IPFS API. |
so, i've been just hit by this (a conflict with jenkins port in my case). i think picking a stable non-assigned and non-popular port is a must for further wider adoption of ipfs (especially for the non-savvy). while a sudden change may (and will) bring confusion for some but this will be time-limited (a month at most? imo it's just about updating the defaults in most popular programs such as ipfs-companion and official documentation) and it in the long term it will settle this issue forever! also, when ipfs is widely adopted, this has to be done anyway so why do it now? after reading through rfc6335 (iana port number application process) i suggest we come up with:
and fill this form: https://www.iana.org/form/ports-services if you provide the information in this issue's comments, i can try to go through the registration process on your behalf. cheers! |
True.
A thing we might want to change, as the browsers are probably trying both protocols.
Using non-localhost addresses is difficult since we would need to tweak the dns-calls, since I think the port idea Well, no browser show localhost websites as secure: (all freshly installed) |
It's a little more complicated.
By "not marked", I mean that the URL bar doesn't explicitly say "Not Secure" or include a lock with a line through it. Try By "secure context", I mean the website can access APIs reserved for websites running in a secure context (can make requests with HTTPs, can access the web crypto APIs, can access the camera, etc.). The other half of this is that the subdomain gateway feature only works with |
Well, at least Firefox do should an 'insecure' lock.
Yeah that's what I meant with catch-all. Is it possible to register new protocols in the modern browsers (like we basically already do with |
I've changed that: |
*.localhost isn't a catch-all in Firefox which is probably part of why it's treated as insecure. They don't implement let-localhost-be-localhost which means requests to ipfs.io.ipns.localhost could end up going to a remote server. Chrome forces all requests to *.localhost to go over 127.0.0.1 (maybe ::1 in the case of ipv6?). Example showing what I mean where I've deliberately poisoned my DNS: |
@aidanharris Firefox is working on implementing
@RubenKelevra Not at the moment, but we hope it will be possible then the last Milestone of protocol-handler-api-for-browser-extensions.md lands in some form in Chromium/Firefox. Right now we are looking into allowing dweb protocols in 👉 Please let's avoid further off-topics, this issue is about picking ports :-) |
I think this would be a neat API-Port. Swarm should be ideally port 443 UDP+QUIC/TCP for servers, to avoid firewall restrictions. On all other nodes, we should use IMHO a random port (where we don't have any privileges to use 443). That's what browsers are doing for WebRTC as well, so either this works or we need to use a relay for incoming connections and won't take part on the DHT. Sure, users could create port forwardings in their routers, but TBH most users don't even know what ports are and why they need to open one. Instead, we could advise them to activate UPnP in their routers. Furthermore, devices will become more and more mobile so users are switch between their wifi, the wifi of their coffee shop, the wifi at work, and their mobile connection. Most of these connections won't allow any configurations by the users. So we need a solution which just 'works'. A static port isn't really helpful in those cases, but is prone to blocking and like BitTorrent has seen in the past, getting a lower quality of service when much data is transferred over it. Since the web gateway port is somewhat of a transition technology, I think we shouldn't give this one that much attention. Just use one which isn't used that much. The best-case scenario is port 80 in this case, but this is probably hardly possible in most installations. |
Back to the original topic, CISCO's acwebsecagent seems to like port 5001 (#7865 (comment)):
|
I think we got two ports now: 4737 from @jbenet and 6437 from @ruverav. How about using the 4737 for the web gateway function and 6437 for the more technical API port by default? The swarm port should just be randomly chosen by default to avoid conflicts and avoid that we receive packages from an old instance after a restart of the daemon. If one of them is blocked, the daemon could just increase both by 1 until both are free. While not ideal this solves the issue with multiple instances running on the same machine without user interventions. |
I still would like to see specifically port 8080 (Gateway) to change for sure (eg. 6547 is fine). |
@Stebalien Any update on this? |
We have |
This would make the "mixing IPFS with torrents" hack more reliable and less dependent on public gateways: https://www.reddit.com/r/ipfs/comments/qnlrgx/mixing_ipfs_and_torrents/ |
@micahscopes this issue is blocked on #8847 |
Good to know! I was just chiming in with another usecase for this |
port 8080 is often in use on servers. it's the case here, and blocks that part of the daemon from starting up:
IANA allocated port 8080 to web caches:
...but it's frequently squatted by a hodge-podge array of random offenders (e.g. Icecast, in my case, Apache Tomcat, Syncthing, etc). ipfs is the latest addition to the stack. :p
5001 is allocated to an obscure:
... but it is also used by
iperf
(oh that could be pretty fireworks), Slingbox and Synology, according to Wikipedia.the port should at least be customizable, maybe it is, but
ipfs daemon --help
doesn't tell me how.i also believe a standard port pair should be requested from IANA, unless an RFC is made for HTTP/3 and the ipfs port becomes
80
. :p but maybe that's a separate issue?at least finding less busy ports would be a good idea. according to wikipedia at least 8082, 8084 and 8085 are free if you like the 80XX range, and 5020+ is also free.
For more sources on ports:
The text was updated successfully, but these errors were encountered: