8000 feat: add port-forward subcommand by deansheather · Pull Request #1350 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

feat: add port-forward subcommand #1350

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
May 18, 2022
Prev Previous commit
Next Next commit
chore: block unix forwarding on windows
  • Loading branch information
deansheather committed May 17, 2022
commit fd7e32c9e2d07b2ca7786460c1b611de87578367
6 changes: 4 additions & 2 deletions agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -658,15 +658,17 @@ func (a *agent) handleDial(ctx context.Context, label string, conn net.Conn) {
network := u.Scheme
addr := u.Host + u.Path
if strings.HasPrefix(network, "unix") {
if runtime.GOOS == "windows" {
_ = writeError(xerrors.New("Unix forwarding is not supported from Windows workspaces"))
return
}
addr, err = ExpandPath(addr)
if err != nil {
_ = writeError(xerrors.Errorf("expand path %q: %w", addr, err))
return
}
}

a.logger.Warn(ctx, "yeah", slog.F("network", network), slog.F("addr", addr))

d := net.Dialer{Timeout: 3 * time.Second}
nconn, err := d.DialContext(ctx, network, addr)
if err != nil {
Expand Down
0