Git Product home page Git Product logo

Comments (10)

jameshhx avatar jameshhx commented on May 22, 2024 2

I've been able to limit the address upon which at least the IPv4 server listens upon, by editing src/web_server.c, to name.sin_addr.s_addr = htonl (INADDR_LOOPBACK);.

I'll do some tinkering over the next few days, and see if I can get a PR in for this.

from netdata.

ktsaou avatar ktsaou commented on May 22, 2024

netdata needs some work in order to:

  1. Accept one or more IPv4 and/or IPv6 IP:PORT pairs to listen to.
  2. Possibly limit its access to specific clients (IPs, subnets).

These are not in my priority list (I have to spend some time learning how to do them properly).

If however, you (or anyone else) can provide a pull request, I'll be glad to merge it.

For the moment, you can limit it with a firewall / iptables statements. If you need such iptables statements, I can provide these to you.

from netdata.

cyayon avatar cyayon commented on May 22, 2024

Ok, thanks for your answer, it was just a suggestion ...
At the moment, i use iptables rule too.

I am not a good C programmer, but perhaps, i could try to submit you a patch to limit listening on an Ip address (at least IPv4).

from netdata.

ktsaou avatar ktsaou commented on May 22, 2024

Perfect!

from netdata.

herrernst avatar herrernst commented on May 22, 2024

If your host has IPv6, you probably also have to change in6addr_any to in6addr_loopback.

from netdata.

ktsaou avatar ktsaou commented on May 22, 2024

Just added this feature.
a44f489

Please test.
The configuration file now has the option bind socket to IP in section [global].

from netdata.

herrernst avatar herrernst commented on May 22, 2024

Works for my (I specify 127.0.0.1 and it only listens on this). You just can't listen on localhost4 and localhost6 at the same time, but that doesn't matter for me.
Thank you!

from netdata.

ktsaou avatar ktsaou commented on May 22, 2024

I think that when you listen on ::1 it also listens on 127.0.0.1.
But no the other way around.

At least on my tests...

from netdata.

herrernst avatar herrernst commented on May 22, 2024

You're right, thanks!

from netdata.

ktsaou avatar ktsaou commented on May 22, 2024

ok, I close this.

from netdata.

Related Issues (20)

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.