Giter VIP home page Giter VIP logo

scc-state's Introduction

scc-state

Cluster state tracking and notification engine for SCC.

Usage

SCC_STATE_LOG_LEVEL=1 node server.js

Log levels

  • 3 - log everything
  • 2 - warnings and errors
  • 1 - errors only
  • 0 - log nothing

Build and deploy to DockerHub

Replace x.x.x with the version number.

docker build -t socketcluster/scc-state:vx.x.x .
docker push socketcluster/scc-state:vx.x.x

scc-state's People

Contributors

benv avatar jondubois avatar megagm avatar toredash avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scc-state's Issues

Bug: using FORWARDED_FOR_HEADER treats IP as IPv6

There seems to be a bug when using FORWARDED_FOR_HEADER.

I have scc-state behind a AWS ALB load balancer, which add "X-Forwarded-For" header to HTTP request to inform about the callers IP address. I added FORWARDED_FOR_HEADER="x-forwarded-for" to scc-state, and based on the logs from scc-state, it is reporting correctly the IP address of scc-worker and scc-broker processes connection to scc-state via the ALB.

But when scc-state calls getSCCBrokerClusterState, it will return an URI with brackets [] : https://github.com/SocketCluster/scc-state/blob/master/server.js#L79-L85, causing the workers to throw an parse error since ws://[10.150.34.147]:50020/socketcluster is not a valid URI.

It will only return a non-bracket (IPv4) URI if instanceIp is provided :

// Only set instanceIpFamily if data.instanceIp is provided.

I'm not sure if this is considered a bug, but I expected scc-state to be able to detect what instanceIpFamily should be when using FORWARDED_FOR_HEADER.

Error conecting from server to state server

We try to connect from one server to state server and het this error

{ CompatibilityError: The undefined@undefined at address ::ffff:xxxxxx is incompatible with the scc-state@^6.0.3. Please, update the undefined up to version ^6.0.0

Bind to a specific IP?

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).

Upgrade to SC 5?

Hey Jon,

Is there a reason why sc-state-server is on SC 4.3.x? Thanks!

  • Nick

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.