Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/siketyan/nakoud
🐳 Access your Docker containers easily without port forwarding
https://github.com/siketyan/nakoud
docker go http-proxy networking
Last synced: 10 days ago
JSON representation
🐳 Access your Docker containers easily without port forwarding
- Host: GitHub
- URL: https://github.com/siketyan/nakoud
- Owner: siketyan
- License: mit
- Created: 2023-04-28T10:14:19.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-01T17:18:28.000Z (3 months ago)
- Last Synced: 2024-10-04T12:49:42.006Z (about 1 month ago)
- Topics: docker, go, http-proxy, networking
- Language: Go
- Homepage:
- Size: 89.8 KB
- Stars: 28
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nakoud
[![go](https://github.com/siketyan/nakoud/actions/workflows/go.yaml/badge.svg)](https://github.com/siketyan/nakoud/actions/workflows/go.yaml)
[![docker](https://github.com/siketyan/nakoud/actions/workflows/docker.yaml/badge.svg)](https://github.com/siketyan/nakoud/actions/workflows/docker.yaml)Access your Docker containers easily without port forwarding
```mermaid
flowchart LR
client[Client]
nakoud[nakoud-proxy]
containerA[Container A]
containerB[Container B]
client -- HTTP/1.1 CONNECT --> nakoud
client -- HTTP/1.1 GET --> nakoud
subgraph network [Docker Network]
nakoud -- TCP --> containerA
nakoud -- HTTP --> containerB
end
```> **Warning**
> This product is still in development and for development environment.
> Do not use in any production environment.## Getting Started
### Run the proxy
The nakoud proxy works as a HTTP proxy, to accept connections from your client.
This will be the entrypoint of all connections to Docker containers, instead of port forwarding.```shell
docker network create nakoud
docker run \
-p '127.0.0.1:8080:8080/tcp' \
-p '[::1]:8080:8080/tcp' \
-v '/var/run/docker.sock:/var/run/docker.sock:z' \
--network nakoud \
ghcr.io/siketyan/nakoud:latest
```### Run your application
You don't need port forwarding your application from now.
To access through nakoud, run your application in the nakoud network, with a label to specify the FQDN to access using.```shell
docker run \
# No port forwarding (-p) is needed :)
--network nakoud \
--label 'jp.s6n.nakoud.fqdn=nginx.nakoud.local' \
nginx:latest
```### Test the connection
Use telnet or some TCP client to test the connection.
```shell
telnet localhost:8080
```
Once you connected to the nakoud proxy, type these to request `/` from nginx (`+` is what you type, `-` is what you receive):```diff
+ CONNECT nginx.nakoud.local:80 HTTP/1.1
+
- HTTP/1.1 200 OK
- Content-Length: 0
-
+ GET / HTTP/1.1
+ Host: nakoud.nginx.local
+
- HTTP/1.1 200 OK
- Server: nginx/1.23.4
- Date: Sat, 29 Apr 2023 07:55:11 GMT
- Content-Type: text/html
- Content-Length: 615
- Last-Modified: Tue, 28 Mar 2023 15:01:54 GMT
- Connection: keep-alive
- ETag: "64230162-267"
- Accept-Ranges: bytes
-
-
-
- ...(truncated)
```Welcome to nakoud!
## Roadmap
There are more things to do:
- [x] Other HTTP methods support than CONNECT method
- [ ] Intermediate TLS certificate
- [ ] Automatic FQDN without labeling (`.nakoud.local` or something)
- [ ] Docker Compose support (`..nakoud.local` or something)
- [ ] HTTPS, SOCKS proxy... and more!
If you have an idea to improve nakoud, please file at [Issues](https://github.com/siketyan/nakoud/issues).
## FAQ
### What is "nakoud" from?
"nakoud" is originally from "nakoudo" which means a matchmaker in Japanese.
The nakoud proxy receives a request from your client and intermediate it through Docker network.
It looks like a matchmaker, and also it is a daemon; typically daemons are named with "d" suffix, so we named this "nakoud".