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

Client side of the registration service. #58

Merged
merged 1 commit into from
Feb 23, 2016

Conversation

fabricedesre
Copy link
Collaborator

This is the client side of https://github.com/fxbox/registration_server
By default it pings the registration server every minute and will expect the server to be on localhost.

There's a public endpoint running for test purposes: use the following command line to use it:
RUST_LOG=info cargo run -- -r http://cloud.desre.org:4242/register

r? @arcturus

use std::thread;

const DEFAULT_ENDPOINT: &'static str = "http://localhost:4242/register";
const REGISTRATION_INTERVAL: u64 = 1; // in minutes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: u32 will be enough :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, just did that to avoid a cast in Duration::from_secs(). I can change it if you prefer.

@arcturus
Copy link
Contributor

r+

mainly nits, the only problem we need to solve is the macosx use case for network interfaces names.

I patched locally and managed to get registered, this is the output in the registration server:

[{ "public_ip": "90.206.147.50",  "local_ip": "192.168.0.7", "timestamp": 1456255841 }]

@arcturus
Copy link
Contributor

I'm just thinking, what about those devices that have 2 ip addresses?
Should we add an extra parameter in the command line to specify, either the interface or the ip address foxbox should use?

Maybe we can do this in a follow up.

fabricedesre added a commit that referenced this pull request Feb 23, 2016
Client side of the registration service.
@fabricedesre fabricedesre merged commit 1f3ee73 into fxbox:master Feb 23, 2016
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.

None yet

2 participants