Commit Graph

3 Commits

Author SHA1 Message Date
Praveen Kumar
137f404640 Add functionaility to expose unix/tcp over named pipe for windows
With this PR expose API can handle npipe as a protocol which is used
in windows to expose socket to named pipe.

Following is now working. (Tested with CRC)
```
--- captured from the VM ---
$ curl http://host.crc.testing:7777/services/forwarder/all | jq .
[
  {
    "local": "127.0.0.1:2222",
    "remote": "192.168.127.2:22",
    "protocol": "tcp"
  },
  {
    "local": "127.0.0.1:9090",
    "remote": "192.168.127.2:9090",
    "protocol": "tcp"
  },
  {
    "local": "\\\\.\\pipe\\crc-podman",
    "remote": "ssh-tunnel://core@192.168.127.2:22/run/podman/podman.sock?key=C%3A%5CUsers%5Cprkumar%5C.crc%5Cmachines%5Ccrc%5Cid_ecdsa",
    "protocol": "npipe"
  }
]
\\.\pipe\crc-http - - [23/Feb/2022:10:38:20 +0530] "POST
/network/services/forwarder/expose HTTP/1.1" 200 0
INFO Listening on: \\.\pipe\crc-podman

> $Env:DOCKER_HOST = "npipe:////./pipe/crc-podman"
> .\docker.exe info
  Client:
  Context:    default
  Debug Mode: false

  Server:
  Containers: 1
  Running: 1
  Paused: 0
  Server Version: 3.4.4
  Storage Driver: overlay
  Backing Filesystem: xfs
  Supports d_type: true
```

Signed-off-by: Praveen Kumar <kumarpraveen.nitdgp@gmail.com>
Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
2022-02-23 15:29:15 +05:30
Jason T. Greene
4e5064a21a Update dyanamic ssh-tunnel port to reuse existing ssh-forwarding code and capabilities
Also:
- Introduce cleanup mechanism for unexpose
- Minor enhancement to bastion/forwarder to support tunnel only operation

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2022-02-12 02:11:00 -06:00
Jason T. Greene
db04e7ddba Implement windows ssh proxy with windows pipe support
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2022-01-14 01:33:01 -06:00