mirror of https://github.com/docker/docker-py.git
Support https:// URLs (replacing with wss://) when attaching websocket
This commit is contained in:
parent
6e659ba12a
commit
cf35b38433
|
|
@ -154,7 +154,9 @@ class Client(requests.Session):
|
||||||
def attach_websocket(self, container, params=None):
|
def attach_websocket(self, container, params=None):
|
||||||
url = self._url("/containers/{0}/attach/ws".format(container))
|
url = self._url("/containers/{0}/attach/ws".format(container))
|
||||||
req = requests.Request("POST", url, params=self._attach_params(params))
|
req = requests.Request("POST", url, params=self._attach_params(params))
|
||||||
full_url = req.prepare().url.replace("http://", "ws://", 1)
|
full_url = req.prepare().url
|
||||||
|
full_url = full_url.replace("http://", "ws://", 1)
|
||||||
|
full_url = full_url.replace("https://", "wss://", 1)
|
||||||
return self._create_websocket_connection(full_url)
|
return self._create_websocket_connection(full_url)
|
||||||
|
|
||||||
def _create_websocket_connection(self, url):
|
def _create_websocket_connection(self, url):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue