Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: access original URL #26

Open
hahla opened this issue Jul 28, 2014 · 1 comment
Open

Feature request: access original URL #26

hahla opened this issue Jul 28, 2014 · 1 comment

Comments

@hahla
Copy link

hahla commented Jul 28, 2014

I'm not sure this is possible (I experimented) with the current library, so am assuming this is more a feature-request. Basically I'd like to get the original URL, which is parsed on line 610 of the request, but not made accessible to my protocol or factory verb, self.location, version = request.split(" ")

Reason, is that I would like to use the URL as a type of sub-protocol router. In meantime I will just have my ws client send the necessary information over the ws, but still I think this could be nice to have.

Here's my init code by the way:

listen_str = 'ssl:%s:privateKey=%s:certKey=%s' % (port, key, cert)
listen(listen_str, WebSocketFactory(MyFactory))
@kpreid
Copy link
Contributor

kpreid commented Jul 29, 2014

FYI, the information is available from the protocol as self.transport.location. The catch is that you're not notified when it becomes available; I worked around this by making sure the client always sent a message as soon as it connected and checking the URL in dataReceived.

I agree there should be a notification when the URL has come in, but I understand @MostAwesomeDude intends to deprecate txWS in favor of upcoming WebSocket support in Twisted itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants