[Twisted-Python] stop/start client connections with loseConnection in ReconnectingClientFactory

Chris Withers chris at withers.org
Tue Apr 2 01:50:31 MDT 2019


On 02/04/2019 08:25, Tobias Oberstein wrote:
>>> https://github.com/crossbario/autobahn-python/blob/master/examples/twisted/wamp/basic/client_using_clientservice.py 
>>
>> Any way to get rid of the ugly duplication between the url in line 69 
>> and the endpoint on line 72?
>>
>> I seem to remember that ends up happening with or without ClientService.
> 
> I am aware, but no, it's designed like this, because WebSocket requires 
> a HTTP URL (with potentially path components, query parameters etc) in 
> the opening handshake while the _transport_ does not necessarily have that.
> 
> Autobahn allows you to run WebSocket over basically everything that is a 
> bidirectional byte pipe: TCP of course, but also Unix domain socket, 
> pipes, Tor onion services (via https://github.com/meejah/txtorcon) and 
> even serial ports!

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 
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?

(This isn't necessarily aimed at AutoBahn, seems to be something common 
in Twisted...)

Chris




More information about the Twisted-Python mailing list