ruoshan / autoportforward Goto Github PK
View Code? Open in Web Editor NEWBidirectional port-forwarding for docker, podman and kubernetes
License: BSD 3-Clause "New" or "Revised" License
Bidirectional port-forwarding for docker, podman and kubernetes
License: BSD 3-Clause "New" or "Revised" License
Hello
I have mac on Apple Silicon M1. When I try to run apf I get en error
apf -r 9003 -k namespace/pod
panic: Failed to establish manager stream: EOF
goroutine 1 [running]:
main.main()
/home/runner/work/autoportforward/autoportforward/cmd/apf/apf.go:123 +0xe8c
Any ideas on how to fix this?
Running this per the documentation does not seem to work.
$ apf redis
* ==> : Forwarding local listening ports to (==>) remote ports
* <== : Forwarding to local ports from (<==) remote listening ports (use -r option)
No ports are opened.
I have tried builds from commit 38558a1 and b8059ea. I've tried the -d
option, but the log file is empty
Docker version 20.10.12, build e91ed5707e
Linux archlinux 5.15.10-arch1-1 #1 SMP PREEMPT Fri, 17 Dec 2021 11:17:37 +0000 x86_64 GNU/Linux
Let me know if you need any other information
~ ➤ docker run -d --name redis redis
ae44475c8835158e4c1d36406de38048b3b797e49f5f86a80e23f3e330b89c9f
~ ➤ apf redis
* ==> : Forwarding local listening ports to (==>) remote ports
* <== : Forwarding to local ports from (<==) remote listening ports (use -r option)
Forwarding: []panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x18 pc=0x102cdff34]
goroutine 8 [running]:
io.ReadAtLeast({0x0, 0x0}, {0x140000ae00a, 0x3, 0x3}, 0x3)
/opt/hostedtoolcache/go/1.17.5/x64/src/io/io.go:328 +0x74
io.ReadFull(...)
/opt/hostedtoolcache/go/1.17.5/x64/src/io/io.go:347
github.com/ruoshan/autoportforward/manager.(*Manager).receivingLoop(0x14000066000)
/home/runner/work/autoportforward/autoportforward/manager/manager.go:86 +0xb8
created by github.com/ruoshan/autoportforward/manager.(*Manager).Run
/home/runner/work/autoportforward/autoportforward/manager/manager.go:74 +0x54
~ ➤
For some reason most browsers seem to block webservers on ports higher than 10K.
Apf now by default maps all server containers (80) to host port 10080. I tried Nginx and httpd.
Maybe change the default port to something like 9080 or 8080 to avoid this problem.
Docker ➤ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c88969704c48 nginx "/docker-entrypoint.…" 15 minutes ago Up 15 minutes 80/tcp nginx
Docker ➤ apf nginx
* ==> : Forwarding local listening ports to (==>) remote ports
* <== : Forwarding to local ports from (<==) remote listening ports (use -r option)
Forwarding: [10080 ==> 80]
Get request from Netcat. Website root (Nginx default page) is loaded.
Docker ➤ nc localhost 10080
GET / HTTP/1.2
Host: localhost
HTTP/1.1 200 OK
Server: nginx/1.21.4
Date: Thu, 10 Feb 2022 09:28:03 GMT
Content-Type: text/html
Content-Length: 615
Last-Modified: Tue, 02 Nov 2021 14:49:22 GMT
Connection: keep-alive
ETag: "61814ff2-267"
Accept-Ranges: bytes
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
Docker ➤
Please add command line argument to extend your tool for other container runtimes.
It is probably easy to add Podman support. It has compatible command line for cp
/exec
commands.
Containerd doesn't have cp
command, but it looks for k8s you do same as described here containerd/containerd#2044.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.