Skip to content

Instantly share code, notes, and snippets.

@hirokiky
Created April 28, 2016 08:25
Show Gist options
  • Save hirokiky/88a108cf23c20383c2c13ed5b3f2a321 to your computer and use it in GitHub Desktop.
Save hirokiky/88a108cf23c20383c2c13ed5b3f2a321 to your computer and use it in GitHub Desktop.
TSL supported WebSocket for docker-py
import docker
class WSFixedClient(docker.Client):
def _create_websocket_connection(self, url):
sslopt = {}
if self.cert:
sslopt["certfile"] = self.cert[0]
sslopt["keyfile"] = self.cert[1]
return websocket.create_connection(
url, sslopt=sslopt,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment