Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8878745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:47:15+00:00 2026-06-14T19:47:15+00:00

When upgrading an HTTP connection to a websocket, one can provide one or more

  • 0

When upgrading an HTTP connection to a websocket, one can provide one or more subprotocols in the optional HTTP header ‘Sec-WebSocket-Protocol’.

If the server accepts any of the subprotocols it responds with HTTP response code 101 (“HTTP/1.1 101 Switching Protocols”) and includes the HTTP header ‘Sec-WebSocket-Protocol’ indicating the selected subprotocol.

But how should the server correctly handle an unknown/unsupported subprotocol?

Should this be done ‘within’ the HTTP connection — by use of some HTTP response code?

Or should the connection be upgraded to a websocket — and immediately be closed by the server by sending a ‘Close Frame’ with some of the predefined websocket Status codes?

What does the RFC6455 say? I cannot come to a conclusion.
How does existing server implementations handle it?

Regards
/Per/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T19:47:16+00:00Added an answer on June 14, 2026 at 7:47 pm

    From a brief glimpse at RFC 6455, I believe the WebSocket Subprotocol is optional and negotiated. In section 4.2.2, under "Server Rquirements":

       /subprotocol/
          Either a single value representing the subprotocol the server
          is ready to use or null.  The value chosen MUST be derived
          from the client's handshake, specifically by selecting one of
          the values from the |Sec-WebSocket-Protocol| field that the
          server is willing to use for this connection (if any).  If the
          client's handshake did not contain such a header field or if
          the server does not agree to any of the client's requested
          subprotocols, the only acceptable value is null.  The absence
          of such a field is equivalent to the null value (meaning that
          if the server does not wish to agree to one of the suggested
          subprotocols, it MUST NOT send back a |Sec-WebSocket-Protocol|
          header field in its response).  The empty string is not the
          same as the null value for these purposes and is not a legal
          value for this field.  The ABNF for the value of this header
          field is (token), where the definitions of constructs and
          rules are as given in [RFC2616].
    

    The server should not send a subprotocol response header with a value other than ‘null’ if it did not agree to use the subprotocol with the client, and it is the client’s responsibility to either continue or terminate the connection at that point.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is a site that I'm upgrading for one of my clients: http://home.minitraper.pl/ As
I am upgrading from the old SecureWebPages that automates the switching between Http and
I used this example (http://reecon.wordpress.com/2010/04/25/uploading-files-to-http-server-using-post-android-sdk/) to upload file from android device to server, it
As we know there are several methodology for http connection. My social network application
I need to provide a way of users uploading multiple files (can be 10MB
after upgrading to Firefox 7, I can't download files I output via PHP on
I'm trying to upload large files with php to an ftp server. I can
In the instruction ( http://pylonshq.com/docs/en/1.0/upgrading/ ) I find : To upgrade to 1.0, first
I'm upgrading my iPhone application, which has the content downloading function using Http communication.
I've been trying to get the echo server sample in Fleck (C# websocket server

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.