softwaremill / softwaremill/sttp

Websocket Subprotocol support

Open
#935 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement todo
Dominant language
Scala
Stars
1.5k
Forks
338
Avg merge
8h 59m
Merged PRs (30d)
13

Description

It seems there is no support for adding subprotocols to a websocket request.

For Akka backend you can customize the websocket request directly to solve the issue:

AkkaHttpBackend(customizeWebsocketRequest = { request => request.copy(subprotocol = Some("protocol)) })

Others allow you to manually set the Sec-WebSocket-Protocol header directly. (AHC for instance)
HttpClient however throws an exception when trying to add the header.

Are there plans to support subprotocols in a generic way across all backends?
Or can I just open a PR adding it to HttpClientAsyncBackend, since that is what I need at the moment?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the AkkaHttpBackend websocket-request customization with HttpClientAsyncBackend, where adding the Sec-WebSocket-Protocol header currently throws an exception. Determine how subprotocols could be represented consistently across the backends, then verify the behavior for both the Akka customization and HttpClientAsyncBackend use case.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
backend, networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.