blob: bd541377b40f1fcab32b58ff314b9ea1af7fa850 (
about) (
plain)
1
2
3
4
5
6
7
8
9
|
import re
def http_endpoint_url(socket_url: str) -> str:
url = re.sub(r"^ws", "http", socket_url, flags=re.IGNORECASE)
url = re.sub(
r"(\/socket\/websocket|\/socket|\/websocket)\/?$", "", url, flags=re.IGNORECASE
)
return re.sub(r"\/+$", "", url)
|