-2

We have a requirement that we need to run a service for N different IPs on a same port but have only one network interface.

Is the same possible in Python - I do not have any code to share

Programmer
  • 8,303
  • 23
  • 78
  • 162

1 Answers1

0

this isn't really anything to do with Python, most operating systems allow you to associate multiple IP addresses with the same adapter. see here for some ways to do this under Linux

in Python you'd just bind to 0.0.0.0 (and/or :: for IPv6) and, assuming you'd set things up elsewhere appropriately, it should just work

Sam Mason
  • 15,216
  • 1
  • 41
  • 60
  • What IP address is 0.0.0.0 and what needs to be setup? – Programmer Jul 25 '19 at 16:12
  • 1
    I assumed you knew how networking/sockets work! see https://stackoverflow.com/a/20778887/1358308 for a primer. there are lots of tutorials/blog articles about this – Sam Mason Jul 25 '19 at 16:15