Add a prefix of 127.0.0.1 to address if only port is specified #43
Loading…
Reference in New Issue
No description provided.
Delete Branch "debug"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
For some reason, go-sbot was not accepting connections when the address was specified in config.toml as:
lis = "127.0.0.1:8008" (version A)
However, if we specified the address in config.toml as:
lis = ":8008" (version B)
then go-sbot would happily accept connections, invites and sync with peers :-)
However, if we specified the address as so, then golgi stopped being able to communicate with go-sbot for some reason.
So it was a sort of catch22, which took me a while to pin down exactly, where in version A go-sbot can talk to peers, and in version B golgi can talk to go-sbot.
I'm not sure why this is the case, but empirically this is what I found.
In this PR, I make it so that if golgi finds that a configured address starts with :, then it prefixes it with 127.0.0.1.
This is tested and now if we specify the address with version A in config.toml, then both things are working.
@notplants
The behaviour of version B matches the example given in the go-sbot config example:
27a936da80/docs/config.md
I suspect version A would have worked if you used
localhost
instead of127.0.0.1
. That's the approach I was using when testing PeachPub.I wonder if it's better to prefix
localhost
or127.0.0.1
, and what the difference might be?Here's how I handle the
lis
config value for display in the web interface sbot settings page: https://git.coopcloud.tech/PeachCloud/peach-workspace/src/branch/main/peach-web/src/routes/settings/scuttlebutt/configure.rs#L36Interesting question, I hadn't looked this up before either. According to this post and this post localhost is usually just a local domain which is mapped to the IP address 127.0.0.1 which is the "self" ip address. The first post also says that using 127.0.0.1 is faster than localhost because it doesn't require a lookup of the IP address from the domain (although I guess this difference is negligible).
All these committs were merged via this PR #41, so I am closing this branch.
Pull request closed