Git Product home page Git Product logo

autoportforward's People

Contributors

l4zy0n3 avatar milanvives avatar ruoshan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

autoportforward's Issues

apf exits after startup

if container use some common port which already used in the host node, such as ssh(22), http(80)
the apf-agent may panic
image

Cant run apf on n Apple Silicon M1

Hello
I have mac on Apple Silicon M1. When I try to run apf I get en error

apf -r 9003 -k namespace/pod

  • ==> : Forwarding local listening ports to (==>) remote ports
  • <== : Forwarding to local ports from (<==) remote listening ports (use -r option)

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?

Not working with Docker per example

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

Invalid memory address or nil pointer dereference on M1

~ ➤ 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
~ ➤

Change default host port for webserver containers from 10080 to something under 10K

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 ➤

Browser
Screenshot 2022-02-10 at 10 30 59

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.