Skip to content

"{ValueError} scheme http+docker is invalid" raised when attaching WebSocket  #1478

@adamlavie

Description

@adamlavie

When trying to attach a WebSocket, a {ValueError} scheme http+docker is invalid raised.
Using docker-py==2.1, websocket-client==0.40.0, docker 1.12.5.
Executing the following before/after container run command brings out the same result. The Code used to attach a new WebSocket is as follows:

sock = self.client.api.attach_socket(self.container_id, params={ 'origin': 'http://127.0.0.1:4502' }, ws=True)

The Exception is actually raised from the websocket.create_connection function. This is the URL passed to the create_connection function (generated by docker-py):
http+docker://localunixsocket/v1.24/containers/50aa7d8e10a0a15ffc659e754ebfbe230981dde16d739b53d729d20fea8c1c41/attach/ws?origin=http%3A%2F%2F127.0.0.1%3A4502

Is this a bug or miss-usage? I've gone over the tests and there does't seem to be an attach_socket test that uses websocket.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions