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

Handle data callback #2

Open
martinlevesque opened this issue Jul 13, 2017 · 0 comments
Open

Handle data callback #2

martinlevesque opened this issue Jul 13, 2017 · 0 comments

Comments

@martinlevesque
Copy link

martinlevesque commented Jul 13, 2017

Hey,

Great package! It would be nice to add a config handler whenever any data on a hostname is transfered, example:

let myConfig = [
    {
        name: 'app-1',
        hostnames: [ 'test.myhost.com' ],
        endpoint: { host: '127.0.0.1', port: 3001 },
        dataHandler: function(socket, data) {
             // do something...
        }
    },
      {
          name: 'app-2',
          hostnames: [ 'test2.myhost.com' ],
          endpoint: { host: '127.0.0.1', port: 3002 }
      }
  ];

I need it to calculate the bandwidth usage per hostname, so I would sum the data bytes transferred. It could be useful for other purposes.

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

1 participant