crossbario / crossbario/autobahn-python

Support websocket connections to endpoints which return 301/302 redirects

Open
#1,488 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement websocket
Dominant language
Python
Stars
2.5k
Forks
768
PR merge metrics
No merged PRs in 30d

Description

Hi,

At present, if a websocket connection is attempted to a URL which returns a 301 or a 302 HTTP code, then Autobahn (v21.2.1) will throw an error: WebSocket connection upgrade failed (301 - MovedPermanently).

Looking in the code, I can see a FIXME: handle redirects:
https://github.com/crossbario/autobahn-python/blob/da419362239fa0a758d6c7d9c8c3f6d3aa910cd2/autobahn/websocket/protocol.py#L3676-L3691

It would be awesome if redirects were supported.
Thank you!

Contributor guide

Open the contributing guide

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 at the FIXME in autobahn/websocket/protocol.py around the websocket upgrade failure for HTTP 301 and 302 responses. Trace how the upgrade response is handled, then add coverage for both redirect statuses; done means websocket connections to redirecting endpoints are supported without the current upgrade error.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.