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

Bind to a specific IP? #16

Open
perpetual-hydrofoil opened this issue Jan 2, 2019 · 1 comment
Open

Bind to a specific IP? #16

perpetual-hydrofoil opened this issue Jan 2, 2019 · 1 comment

Comments

@perpetual-hydrofoil
Copy link

perpetual-hydrofoil commented Jan 2, 2019

Is it possible to specify an IP as an env var, a passed argument to node server, etc to bind to for scc-state, scc-broker, etc?

I think this is what I'm looking for in scc-broker, but it doesn't seem to have a parallel in scc-state:
https://github.com/SocketCluster/scc-broker/blob/master/server.js#L9

Without binding to a specific IP, there's no way to take advantage of TUN/TAP virtual devices for encrypted networking (or preventing external access).

@perpetual-hydrofoil perpetual-hydrofoil changed the title Listening on a specific IP? Bind to a specific IP? Jan 2, 2019
@jondubois
Copy link
Member

jondubois commented Jan 9, 2019

@jamiesonbecker SCC_INSTANCE_IP is not the IP address on which the scc-broker server binds itself; it's the IP address which the scc-broker uses to advertise itself to the cluster; so other instances will use this IP address when they want to connect to the scc-broker; it's mostly used when running the instance inside a container to allow it to be referenced by others using a single consistent public IP.

It sounds like what you need is something like the host param which is passed to the Node.js tcp/net server's listen function: https://nodejs.org/api/net.html#net_server_listen_port_host_backlog_callback

This feature is not currently exposed by any component of SCC (you could do it on scc-broker using SOCKETCLUSTER_OPTIONS env variable but it's tricky because it needs to be a JSON object).

PRs to expose this feature directly with a single env var would be welcome but it should be done consistently across both scc-state and scc-broker - Following naming conventions for env vars for different instance types.

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

No branches or pull requests

2 participants