Subject: ALTSVC and mixed scheme

From: Yutaka Hirano <[email-masked]>
Date: Thu, 20 Mar 2014 17:04:08 +0900

Hi,

I am trying to use ALTSVC for the protocol negotiation of WebSocket over
HTTP/2 and I have noticed ALTSVC cannot work with a mixed scheme
environment.
I want to use it to advertise the server's support of WebSocket over HTTP/2.
There are two cases:

 1. An HTTP/2 connection exists. I would like to use ALTSVC frame to
advertise that the server supports WS over HTTP/2.
 2. When an UPGRADE is requested to the server with HTTP/1.1, I would like
to use ALTSVC  response header to advertise that the server supports WS
over HTTP/2.

For the first case, it is not a valid ALTSVC use. When it is sent to the
client, the client will use the alternative service for all requests
including HTTP ones.
For the second case, it is a valid ALTSVC use. Nevertheless, I am not sure
whether the extent of ALTSVC is limited to ws(s):// scheme. If not, the
same problem occurs.

I think it is reasonable to limit the extent of ALTSVC in individual
schemes.
That means a new property for the scheme should be introduced in ALTSVC
frame.

In addition to that, the current alt-svc draft says:
  Using an alternate service implies accessing an origin's resources on an
alternate
  port, at a minimum.
For the first case, I would like to use ALTSVC frame for the same host and
port. Actually, I want the server to say "The client should use h2ws
service (this connection) for wss://(host):(port)/ requests" by using
ALTSVC frame.

Is it possible?

Thanks,