greenled / greenled/portainer-stack-utils

Proxy command doesn't handle websockets

Open
#31 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
75
Forks
16
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
When using PSU as a proxy to an endpoint's Docker daemon, commands requiring a websocket connection (like `docker attach`, `docker exec`, `docker system events`) fail with an `unable to upgrade to tcp, received 200` error or just hang up.

**To Reproduce**
Given:
- There is a "primary" endpoint
- There is a "backend" container running on that endpoint
- There is a Docker client installed locally

Steps to reproduce the behavior:
1. Run `psu proxy --endpoint primary --port 12345`
2. In another shell, run `export DOCKER_HOST=tcp://localhost:12345`
3. Run `docker exec backend echo "hello"`
4. See error

**Expected behavior**
PSU should correctly proxy the request by handling the protocol upgrade

**Standard/Error output**
```
unable to upgrade to tcp, received 200
```

**Standalone executable binary (please complete the following information):**
- OS: Linux
- Shell interpreter: Bash
- Portainer version: 1.21.0
- Program version: 2.0.0-alpha.3

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.