[Twisted-Python] ws(s):// urls and host/port duplication in twisted/autobahn code

Chris Withers chris at withers.org
Wed Apr 10 00:00:40 MDT 2019


On 02/04/2019 09:07, Tobias Oberstein wrote:
>> Right, but correct me if I'm wrong, my understanding is that URL 
>> stands for Univeral Resource Locator and URLs can encode all of the 
>> things you 
> 
> WebSocket needs a _HTTP_ URL

Not sure I follow, I specify ws:// and things work. What am I missing?
(I know the initial protocol is http and that's "upgraded" into 
websocket, but the url is still ws:// or wss://, right?)

> fwiw, WAMP is a protocol with a clear-cut, rigorous and decoupled layering:

Do browsers speak WAMP? Do firewalls get upset with it?

>> describe. They certainly contain the host and port, so shouldn't there 
>> be a graceful way to specify a URL once and have everything that needs 
>> that info or a subset of it get it from there?
> 
> a (fully qualified) HTTP URL of course encodes a host and port, but that 
> only covers transports that have those notions

Not sure what you mean by fully qualified?

>> (This isn't necessarily aimed at AutoBahn, seems to be something 
>> common in Twisted...)
> 
> things look only "simple" when leaving out details;)

There's never a reasonable excuse for duplicating the same information 
within a few lines of code.

Chris




More information about the Twisted-Python mailing list