Skip to content

feat: add custom auth header support in edge mode - #79

Open
TMHBOFH wants to merge 1 commit into
Finsys:mainfrom
TMHBOFH:main
Open

feat: add custom auth header support in edge mode#79
TMHBOFH wants to merge 1 commit into
Finsys:mainfrom
TMHBOFH:main

Conversation

@TMHBOFH

@TMHBOFH TMHBOFH commented Jun 22, 2026

Copy link
Copy Markdown

Summary

Adds custom authentication header support for Edge Mode to allow connections through external authentication proxies (like Traefik with ForwardAuth, Authentik, or Cloudflare Access).

Previously, the Hawser agent could not pass extra HTTP headers when establishing the WebSocket connection to the Dockhand server. If the server was protected by an authentication layer, the connection was rejected and failed with:
WebSocket dial failed: websocket: bad handshake

Changes

  • internal/config/config.go : Added CUSTOM_AUTH_HEADER and CUSTOM_AUTH_TOKEN environment variables to the configuration.
  • internal/edge/client.go : Updated the WebSocket dialer to check for the custom auth variables and inject them into the HTTP request headers during the handshake. Added [INFO] Using custom authentication header: ... logging.
  • README.md: Added documentation and usage examples for the new environment variables.

Usage

docker-compose.yml:

environment:
  - CUSTOM_AUTH_HEADER=Authorization
  - CUSTOM_AUTH_TOKEN=Basic <your-token>

docker run:
-e CUSTOM_AUTH_HEADER=Authorization -e CUSTOM_AUTH_TOKEN="Bearer <token>"

Where the token is used to authenticate the Hawser agent against the external authentication layer in front of the Dockhand server.

Signed-off-by: TMHBOFH <itsystem.bofh@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant