mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2025-01-01 10:04:12 +08:00
13 lines
430 B
Python
13 lines
430 B
Python
from myutils.config import globalconfig
|
|
|
|
|
|
def create_connection(url, header=None, http_proxy_host=None, http_proxy_port=None):
|
|
if globalconfig["network_websocket"] == 1:
|
|
from network.libcurl.websocket import WebSocket
|
|
elif globalconfig["network_websocket"] == 0:
|
|
from network.winhttp.websocket import WebSocket
|
|
|
|
_ = WebSocket()
|
|
_.connect(url, header, http_proxy_host, http_proxy_port)
|
|
return _
|