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

change server bind address #403

Merged
merged 8 commits into from
Mar 19, 2021
Merged

change server bind address #403

merged 8 commits into from
Mar 19, 2021

Conversation

4xMSAA
Copy link
Contributor

@4xMSAA 4xMSAA commented Mar 6, 2021

127.0.0.1 is a loopback interface, and only works on the same host
binding to 0.0.0.0 will allow connections from other hosts and will actually give purpose to the IP field on the plugin

i have a laptop running linux (so cannot use studio) and another host running windows, where i RDP to for studio - i was wondering why it couldn't connect. rebuilt with these changes and it can now listen to the linux host

previously:

[Rojo-Warn] Disconnected from an error: Couldn't connect to the Rojo server.
[Rojo-Warn] Make sure the server is running — use 'rojo serve' to run it!

now:
image
using stable, but change is universal

127.0.0.1 is a loopback interface, and only works on the same host
0.0.0.0 will allow connections from other hosts

ideally, this should be a console arg - but it's a quick fix
@LPGhatguy
Copy link
Contributor

As is, this change is very dangerous! Allowing access for all Rojo connections from outside the current machine opens up a lot of risk for leaking information, or worse, taking advantage of Rojo's two-way sync web API to write files onto the host machine.

Instead, I would accept a PR to make this configurable. Having support for rojo serve --address 0.0.0.0 would let users opt into this behavior.

@4xMSAA
Copy link
Contributor Author

4xMSAA commented Mar 9, 2021

slight nitpick, but contribution page did not mention use of rustfmt - on the other hand, i could have probably been more careful myself

@LPGhatguy
Copy link
Contributor

LPGhatguy commented Mar 19, 2021

Thanks for putting this together!

I pushed a small handful of tweaks to the branch like using SocketAddr, displaying localhost in the console instead of the IP if the IP is loopback (127.0.0.1 or ::1), and updating the changelog.

I'll land this in the master branch and then backport it so it can be part of a Rojo 6 release, too.

@LPGhatguy LPGhatguy merged commit 0e7ba83 into rojo-rbx:master Mar 19, 2021
LPGhatguy added a commit that referenced this pull request Mar 31, 2021
* web/mod.rs - change server bind address

127.0.0.1 is a loopback interface, and only works on the same host
0.0.0.0 will allow connections from other hosts

ideally, this should be a console arg - but it's a quick fix

* implement --address option, revert default bind address to 127.0.0.1

* revert silly autoformatting

* ok, actually using rustfmt now

* More precise --address flag description

* Use SocketAddr where available, take advantage of const-ness

* Display 'localhost' if address is loopback

* Update Changelog

Co-authored-by: Lucien Greathouse <me@lpghatguy.com>
Dekkonot pushed a commit to UpliftGames/rojo that referenced this pull request Jan 11, 2024
* web/mod.rs - change server bind address

127.0.0.1 is a loopback interface, and only works on the same host
0.0.0.0 will allow connections from other hosts

ideally, this should be a console arg - but it's a quick fix

* implement --address option, revert default bind address to 127.0.0.1

* revert silly autoformatting

* ok, actually using rustfmt now

* More precise --address flag description

* Use SocketAddr where available, take advantage of const-ness

* Display 'localhost' if address is loopback

* Update Changelog

Co-authored-by: Lucien Greathouse <me@lpghatguy.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants