Bind server to specific ip (ipv6) address

I am trying to setup a local blynk server. Problem is I have multiple services running on the same device and now I get port binding conflicts.
To solve this I have configured multiple ip addresses on this device (1 ipv4 and multiple ipv6). Every service gets its own ip address. This works quite nice.

Now I am trying to achieve the same with a blynk server but I cannot find any way how to do this. As far as I can see there is no option and I couldn’t find anything to override the listen address.

So how can I make a blynk server to bind on a single specific ip address?

Hello. Not sure I understood you. You have port conflicts but changing IPs?

I have port conflicts (e.g. 8080 is already in use) but IP’s are fixed. I assign them so I know what they are.
My ISP has assigned me one public ipv4 address and a public ipv6 subnet (a /48). So I have public ipv6 addresses I can use which also can have reverse and forward dns entries.

e.g I have different ipv6 addreses for apache, gitlab, grafana. And now I want to assign one to blynk.

Maybe it is easier to change ports?

That will work for sure. I already did this to make sure the serve would at least start.
But if I really want to use this server I like to use the default ports as much as possible and also it will make migrating the servers to a different (dedicated?) system much more easier to do.
Also the server currently binds to all ip’s available which is harder to secure.

So I have multiple reasons (besides aesthetics) to bind on a specific port.

@nhimf I don’t know if Blynk supports ipv6 but have you tried connecting with an ipv6 address?

Something like:

Blynk.begin(auth, ssid, pass, "2001.0db8.0000.0000.0000.ff00.0042.8329");

@Dmitriy do you support ipv6 and if so what format do we use for the addresses?

I haven’t yet tried to connect something to the server, except for my good ol’ web browser.
(I am still is the early playing around stages).

If ipv6 is not possible then binding on just a single ipv4 address would still apply (as is often already in use). Currently by default it binds on all ip’s using tcp6.
My netstat output shows things like this:

tcp6       0      0 :::8081                 :::*                    LISTEN      1007       927968     -                   
tcp6       0      0 :::8082                 :::*                    LISTEN      1007       927967     -                   
tcp6       0      0 :::7443                 :::*                    LISTEN      1007       927966     - 

So the conflicts still are there.


This require code changes.

Can I make a feature request for this? I think more people could use such a feature.

1 Like

Sure. Contributions are always welcome.