MCPcopy
hub / github.com/HelloZeroNet/ZeroNet / getWsServerUrl

Method getWsServerUrl

src/Ui/UiRequest.py:394–402  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

392 return "/" + address
393
394 def getWsServerUrl(self):
395 if self.isProxyRequest():
396 if self.env["REMOTE_ADDR"] == "127.0.0.1": # Local client, the server address also should be 127.0.0.1
397 server_url = "http://127.0.0.1:%s" % self.env["SERVER_PORT"]
398 else: # Remote client, use SERVER_NAME as server's real address
399 server_url = "http://%s:%s" % (self.env["SERVER_NAME"], self.env["SERVER_PORT"])
400 else:
401 server_url = ""
402 return server_url
403
404 def processQueryString(self, site, query_string):
405 match = re.search("zeronet_peers=(.*?)(&|$)", query_string)

Callers 1

renderWrapperMethod · 0.95

Calls 1

isProxyRequestMethod · 0.95

Tested by

no test coverage detected