Skip to content

Commit

Permalink
[analyzer] Add class for IPv6 HTTP server (NASA-SW-VnV#158).
Browse files Browse the repository at this point in the history
This commit adds a new class HTTPServerIPv6 that inherits from
HTTPServer, but selects IPv6. In systems with dual stack (e.g., default
on linux), opening a server in IPv6 also listens in IPv4.
  • Loading branch information
ivanperez-keera committed Oct 29, 2023
1 parent da4a4bf commit fa9f274
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions analyzer/python/ikos/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,21 @@
from http.server import HTTPServer, BaseHTTPRequestHandler
from urllib.parse import parse_qs, urlencode
from urllib.request import urlopen
from socket import AF_INET6
except ImportError:
# Python 2
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from urlparse import parse_qs
from urllib import urlencode
from urllib2 import urlopen
from socket import AF_INET6


class HTTPServerIPv6(HTTPServer):
'''
HTTP server that listens in IPv6.
In systems with dual stack, this also listens in IPv4.
'''

address_family = AF_INET6

0 comments on commit fa9f274

Please sign in to comment.