Document on how to use IPv6 with the http server

This commit is contained in:
Nico Schottelius 2019-09-26 22:56:40 +02:00
parent fdd61daa1e
commit a10d9d4597
1 changed files with 22 additions and 0 deletions

View File

@ -142,6 +142,28 @@ vrrp_instance router_internal_ipv4 {
}
```
## How to enable IPv6 in the Python HTTP Server
If you are coding in python and you want your HTTP server to listen on
IPv6, you can inherit from HTTPServer and set the address family to
*AF_INET6* as follows:
```
from http.server import HTTPServer
class HTTPServerV6(HTTPServer):
address_family = socket.AF_INET6
if __name__ == '__main__':
myv6server = HTTPServerV6
```
For more details on how to use the HTTPServer in general,
checkout
[this stackoverflow post](https://stackoverflow.com/questions/23264569/python-3-x-basehttpserver-or-http-server).
Thanks to cvmiller for this hint!
## How to enable IPv6 in Redhat Linux
While Red Hat is not specifically an application, we still wanted