Upgrading HTTP

#1

Hi,

Is it possible to use a http-server (in twisted) and upgrade it to an Autobahn server when a WS-client connects? Or are there any other schemes for letting autobahn share port with HTTP?

\ Benjamin

0 Likes

#2

It is certainly possible (and totally easy) to run an embedded Web server besides Autobahn within the same Twisted instance,
either on different ports or on same port but bound to different listening IP (see below).

Autobahn itself will serve a HTML status page when accessed from a browser and no Upgrade to WS header is present.

Autobahn does not provide a full featured Web server and does not allow to "share" it's port with i.e. Twisted Web.

This is by design, and by deliberate decision .. and will unlikely change.

"Sharing a port": There is

http://twistedmatrix.com/trac/ticket/4173

which is an somewhat inactive, and far behind WS specs attempt to _extend_ Twisted Web with an embedded WS server.

In general, "sharing" a port between 2 different TCP servers is not meaningful/possible .. you need either extend
an existing Web server with WS or vice versa ..

I don't think it's a good idea to do that WS within Twisted Web .. just my 2cts.

···

Am 22.02.2012 01:21, schrieb Benjamin Bruheim:

Hi,

Is it possible to use a http-server (in twisted) and upgrade it to an Autobahn server when a WS-client connects? Or are there any other schemes for letting autobahn share port with HTTP?

\\ Benjamin

==

However, you can of course have your server network interface bound to 2 IPs (using IP aliases) and then run
Web and WS on same port (i.e. 80), but bound to different IPs ... and this within same Twisted.

\Tobias

0 Likes

#3

For a more recent version of txWebsocket, check out
https://github.com/chadselph/txWebSocket

kind regards,

Jeroen

···

2012/2/22 Tobias Oberstein <tobias.o...@gmail.com>:

Am 22.02.2012 01:21, schrieb Benjamin Bruheim:

Hi,

Is it possible to use a http-server (in twisted) and upgrade it to an
Autobahn server when a WS-client connects? Or are there any other schemes
for letting autobahn share port with HTTP?

\\ Benjamin

It is certainly possible (and totally easy) to run an embedded Web server
besides Autobahn within the same Twisted instance,
either on different ports or on same port but bound to different listening
IP (see below).

Autobahn itself will serve a HTML status page when accessed from a browser
and no Upgrade to WS header is present.

Autobahn does not provide a full featured Web server and does not allow to
"share" it's port with i.e. Twisted Web.

This is by design, and by deliberate decision .. and will unlikely change.

"Sharing a port": There is

http://twistedmatrix.com/trac/ticket/4173

which is an somewhat inactive, and far behind WS specs attempt to _extend_
Twisted Web with an embedded WS server.

In general, "sharing" a port between 2 different TCP servers is not
meaningful/possible .. you need either extend
an existing Web server with WS or vice versa ..

I don't think it's a good idea to do that WS within Twisted Web .. just my
2cts.

==

However, you can of course have your server network interface bound to 2 IPs
(using IP aliases) and then run
Web and WS on same port (i.e. 80), but bound to different IPs ... and this
within same Twisted.

\Tobias

0 Likes