8000 GitHub - daylennguyen/gh-net: A network bridge between a Codespace and a local machine.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

daylennguyen/gh-net

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Codespaces Network Bridge

🧪 The extension is currently in Preview stage, so some hiccups are expected. Please help us to improve by submitting feedback!

image

This GitHub CLI extension allows to bridge network between a Codespace and your local machine, so the Codespace can reach out to any remote resource that is reachable from your machine. In another words, it uses your local machine as a network gateway to get to those resources.

For instance, if you are using a VPN client to connect to private enterprise network to access a database or any other remote resources, this extension enables you to use those private resources from within a Codespace.

About GitHub CLI.

Prerequisites

  1. This extension depends on the latest features of GitHub CLI(>= v2.8.0), please make sure to upgrade it. If run the gh codespace select command opens the codespace selection dialog, you are good to go.

  2. The extension relies on gh codespace ssh command to establish SSH tunnel to a Codespace, hence you need to setup ssh keys if you didn't before. If you can do sudo gh codespace ssh (sudo is important since kernel might use different identity under non-root user) and connect to a Codespace successfully, - you are good to go. Refer to Generating a new SSH key and adding it to the ssh-agent for more info. List of known issues and workarounds for them can be found here.

  3. If your codespace uses a non-default image, ensure that both the GitHub CLI, openssh-server and sudo are installed inside the codespace. Some distros need an ssh group too. Please see linux dependencies doc for per-distro instructions.

Installation

Mac OSx:

gh extension install github/gh-net

Linux:

sudo gh extension install github/gh-net

The sudo is required during extension installation on Linux due to cli/cli#5456. Hopefully it won't be the case in the future.

Usage

To start network forwarding from a Codespace to a local machine, run:

sudo gh net start

Connection issues? Please see github#9 for some common solutions.

This will provide codespace selection dialog:

image

Select a codespace and press enter. The extension will connect to selected codespace and start forwarding network traffic:

image

There are two panels in the connected view of the extension:

  • Panel on the left (NAT) shows the network address translation table for currently opened connections. For stateful protocols(e.g. TCP) the records are cleaned up automatically after connection is closed so the records will come and go as connection is established and closed. For stateless protocols (e.g. UDP or ICMP) or unsuccessful TCP connections the records are cleaned up after some time, so those will show up in the list for some time.
  • Panel on the right (DNS) shows the resolved DNS records, as hostname, record and time-to-live (TTL) values.

Press q or ctrl + c to stop the extension.

CLI Options

  • --gui: Enable/disable GUI mode. [true | false] [default: true]
  • --dns: Enable/disable DNS resolution. [true | false] [default: true]
  • --trace: Specify tracing verbosity. [none | trace | debug | info | warn | error] [default: info]
  • --telemetry: Enable/disable sending diagnostics telemetry (no PII data is sent). [true | false] [default: true]

Run gh net start -h for details.

Supported platforms

Mac OSx

OS Local
Big Sur (v11)
Monterey (v12)

Linux

Distro Local Inside Codespace
Ubuntu
Debian
Fedora
Red Hat
Mint
OpenSUSE
Centos
Kali
Arch
Alpine ✅ *

Windows

Version Local
Windows 10 🏃
Windows 11 🏃

Supported architectures

Mac OSx

Architecture Status
Intel(AMD64)
Apple silicon (ARM64) ✅ *

Linux

Architecture Status
AMD64
ARM64
ARMv6
ARMv7

Windows

Architecture Status
AMD64 🏃
i386 🏃

Tested VPN Clients

Name Status
Viscocity
GlobalProtect
NordVPN
Tailscale

Legend: ✅ - supported 🏃 - in progress ? - unknown / not tested


For list of supported network protocols refer to this doc.

Troubleshooting

Useful links

About

A network bridge between a Codespace and a local machine.

Resources

Stars

Watchers

Forks

Packages

No packages published
0