Stops the servers.
(self)
| 253 | self.secure_thread.start() |
| 254 | |
| 255 | def stop(self): |
| 256 | """Stops the servers.""" |
| 257 | self.stop_serving = True |
| 258 | with contextlib.suppress(IOError): |
| 259 | _ = urllib_request.urlopen(f"http://{self.host}:{self.port}") |
| 260 | with contextlib.suppress(OSError): |
| 261 | socket.create_connection((self.host, self.secure_port), timeout=1).close() |
| 262 | |
| 263 | def where_is(self, path, localhost=False, secure=False) -> str: |
| 264 | scheme, port = ("https", self.secure_port) if secure else ("http", self.port) |