Setting origin for WebSocketClientFactory fails

#1

Hello there,

The “origin” parameter for WebSocketClientFactory is expected to be a string, but line 3366 of autobahn/websocket.py contains:

request += “Origin: %d\x0d\x0a” % self.factory.origin.encode(“utf-8”)

How is that supposed to work ? Is there a clean alternative for setting the origin parameter ?

Thank you.

0 Likes

#2

The exact line at github is https://github.com/tavendo/AutobahnPython/blob/master/autobahn/autobahn/websocket.py#L3440

···

Em sexta-feira, 26 de abril de 2013 18h53min30s UTC-3, Guilherme Polo escreveu:

Hello there,

The “origin” parameter for WebSocketClientFactory is expected to be a string, but line 3366 of autobahn/websocket.py contains:

request += “Origin: %d\x0d\x0a” % self.factory.origin.encode(“utf-8”)

How is that supposed to work ? Is there a clean alternative for setting the origin parameter ?

0 Likes

#3

    The "origin" parameter for WebSocketClientFactory is expected to be
    a string, but line 3366 of autobahn/websocket.py contains:

    request += "Origin: %d\x0d\x0a" % self.factory.origin.encode("utf-8")

    How is that supposed to work ? Is there a clean alternative for
    setting the origin parameter ?

Thats a bug .. fixed:

https://github.com/tavendo/AutobahnPython/commit/f10191441983ca88f4f8de562dd39d3689b486b4

Please try current HEAD on master branch on GitHub ..

Thanks for reporting!

Tobias

0 Likes