| 215 | """Handles html request.""" |
| 216 | |
| 217 | def __init__(self, *args, **kwargs): |
| 218 | file_path = kwargs.pop("file_path") |
| 219 | self.format = file_path.split(".")[-1] |
| 220 | |
| 221 | if file_path.endswith("html"): |
| 222 | self.page = open(file_path).read() |
| 223 | web_port = kwargs.pop("rpc_web_port", None) |
| 224 | if web_port: |
| 225 | self.page = self.page.replace( |
| 226 | "ws://localhost:9190/ws", f"ws://localhost:{web_port}/ws" |
| 227 | ) |
| 228 | else: |
| 229 | self.page = open(file_path, "rb").read() |
| 230 | |
| 231 | super().__init__(*args, **kwargs) |
| 232 | |
| 233 | def data_received(self, _): |
| 234 | pass |