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 7053411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:30:08+00:00 2026-05-28T03:30:08+00:00

Websocket example in netty (examples) has a http request handler which: performs hand shaking

  • 0

Websocket example in netty (examples) has a http request handler which:

  1. performs hand shaking (at first)

  2. (then) handles different types of WebSocket frames, eventually “TextWebSocketFrame”s.

There is only one url for websocket connections in this example.

The problem is, when TextWebSocketFrame based actual websocket communication starts, there is no direct way to determine websocket url from TextWebSocketFrames themselves (correct me if I am wrong).

So, how to handle different (url) websocket connections in netty?

One solution can be registering channels and their “websocket connection urls” during handshaking process.

The other is having only one websocket connection url and resolving different contexts by adding extra information to websocket messages (TextWebSocketFrames).

I don’t find these solutions elegant, so any ideas?

  • 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-05-28T03:30:08+00:00Added an answer on May 28, 2026 at 3:30 am

    It is my understanding that when you perform a web socket handshake, it is to a specific URL. That is specified in the web socket standard. See RFC 6455. Hence, there is no URL information in the TextWebSocketFrame because the assumption is that the frame will be sent to the URL to which the socket is bound.

    To handle different URLs, you will have to either:

    1. Setup a different pipeline and bind to a different IP and/or port for each URL, or
    2. Like you stated, customise the hand shake and store the URL with the channel.

    Personally, I’ve just used JSON in a TextWebSocketFrame. In my JSON, I have a field that states the intended action. This field is used for routing to the appropriate message handler.

    I think it comes down to a design decision. WebSockets are intended for long lived connections where a request message can have 0, 1 or > 1 responses. This contrasts the REST style 1 request and 1 responses model.

    Hope this helps.

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

Sidebar

Related Questions

In the page http://pypi.python.org/pypi/websocket-client/0.4 the first snippet (the Low Level API example) is very
I want to code a Server which handles Websocket Clients while doing mysql selects
I'm trying to create a simple WebSocket example using the HTML5/JS API. Based on
I'm trying to run Netty Draft10 latest example on top of SSL (WSS) https://github.com/netty/netty/tree/master/src/main/java/org/jboss/netty/example/http/websocketx/server
How feasible is it to translate this Ruby websocket server to PHP? http://github.com/gimite/web-socket-ruby/blob/master/lib/web_socket.rb I
Could someone please give me simple websocket code. I am creating websocket example but
I'm looking for a websocket/node.js chat implementation which supports multiple rooms. I'm also going
Looks like it's easy to add custom HTTP headers to your websocket client with
I am trying to get a simple WebSocket example to work on my machine
The new iOS websocket library, SocketRocket , looks really awesome, and the chat example

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.