Skip to content
This repository was archived by the owner on Oct 20, 2023. It is now read-only.

Commit b1117ff

Browse files
authored
[readme]: WIP
1 parent 3cc4e83 commit b1117ff

File tree

1 file changed

+48
-3
lines changed

1 file changed

+48
-3
lines changed

README.md

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,60 @@
11
## Codespaces Network Bridge GitHub CLI extension
22

3-
### Installation
3+
This [GitHub CLI](https://cli.github.com/) 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 a network `gateway` to get to those resources.
4+
5+
For instance, if you are using `VPN` to connect to your enterprise network to access a database or any other remote resources on the private network, this extension allows you to get to those resources from whithin a Codespace also, so you can develop fully inside a Codespace!
6+
7+
## Installation
48

59
```shell
610
gh extension install legomushroom/gh-net
711
```
812

9-
### Usage
13+
*This extension depends on the latest features of GitHub CLI, please make sure [to upgrade it](https://github.com/cli/cli#installation).*
14+
15+
<details>
16+
<summary>How to check if my version works?</summary>
17+
Run `gh codespace select` command, if it opens the codespace selection dialog, you are good to go!
18+
<img width="749" alt="image" src="https://user-images.githubusercontent.com/1478800/161620032-c999de5a-7445-4662-bedd-95be830556e9.png">
19+
</details>
20+
21+
## Usage
22+
23+
To start network forwarding from whithin a Codespace to your local machine, run:
1024

1125
```shell
12-
gh net start
26+
sudo gh net start
1327
```
1428

29+
> Note: `sudo` privileges are required to bind to network sockets on your machine. In theory user with network administration rights can run this command without sudo, but this scenario is not tested well enough yet, so using `sudo` is the hard requirement at the moment.
30+
31+
This will provide codespace selection dialog:
32+
33+
<img width="749" alt="image" src="https://user-images.githubusercontent.com/1478800/161616184-4cd42419-6d97-440c-bf26-cb713baa7607.png">
34+
35+
Select a codespace and press enter. The extension will connect to selected codespace and start forwarding network traffic:
36+
37+
<img width="749" alt="image" src="https://user-images.githubusercontent.com/1478800/161617508-b65de564-60f3-46c8-8394-5b28c8ac477b.png">
38+
39+
There are two pannels in the connected view of the extension:
40+
41+
- Panel on the left (`NAT`) shows the network address translation table for currently opened connections. For successful stateful protocols(e.g. `TCP`) the records are cleaned up automatically after connection is closed so teh 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.
42+
- Panel on the right (`DNS`) shows the resolved `DNS` records, as `hostname`, `record` and `time-to-live` (or `TTL`) values.
43+
44+
45+
Press `q` or `ctrl + c` to stop the extension.
46+
47+
## How it works
48+
49+
How it works notes.
50+
51+
## Troubleshooting
52+
53+
Troubleshooting notes.
54+
55+
## Supported platforms
56+
57+
- MacOSx AMD64
58+
- Linux AMD64
59+
1560
[About GitHub CLI](https://cli.github.com/)

0 commit comments

Comments
 (0)