portproxy

command
v0.3.30 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2026 License: MIT Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command portproxy is the sidecar half of giving self-hosted service mode a fixed, routable address.

Flockdeck's own server always binds 127.0.0.1 on a port chosen at random each start, with no bind-address flag and no way to pin the port (see internal/server.New) -- deliberately, since a desktop install has no business claiming a fixed port on someone's machine. That is fine for a desktop app, whose window dials its own process directly, but it means a Kubernetes Service or Ingress has nothing stable to route to: the port changes every restart, and nothing outside the pod can be told what it is ahead of time.

Containers in one pod share a network namespace, so a second, tiny container that listens on a fixed port and forwards every byte of every connection to whatever port flockdeck actually bound this run gives a Service exactly the fixed target it needs, without changing a line of flockdeck's own server code. That is all this program does. It discovers flockdeck's real address the same way a second `flockdeck` launch and docker/healthcheck.sh already do -- by reading the instance record flockdeck writes at start-up ($HOME/.config/flockdeck/instance.json, internal/store.SaveInstance) -- and re-reads it on every connection, so a restart that lands on a different port is picked up without this sidecar itself needing to be restarted.

It is deliberately not an HTTP-aware reverse proxy. flockdeck's own server already speaks HTTP, including the WebSocket upgrades /ws/control and /ws/pty use, and a byte-for-byte TCP relay forwards all of it -- headers, chunked bodies, upgrade handshakes, the auth token in the query string -- completely unchanged, without this program having to parse, buffer, or trust any of it. That also means it carries no authorization logic of its own: whoever connects through it still needs the token from the instance record, exactly as they would today over `kubectl port-forward` straight to flockdeck's own loopback port. The sidecar only fixes the address; it changes nothing about who is allowed to use it.

Built as a second binary in the same image as flockdeck itself (see the repository's Dockerfile) rather than shipped as its own container image, so it rides the same build, the same base-image hardening, the same CVE scan and the same cosign signature as flockdeck already gets -- one more image to pull, scan and trust independently would be a worse trade for a program this small.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL