You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[October 25, 2021] Access control for forwarded ports (github#21913)
* update supporting docs
* update sharing a port
* Update image
* Clean up typos
* Apply suggestions from code review
Co-authored-by: Sarah Edwards <skedwards88@github.com>
* Add note about availability of feature
* Update menu name
* Update image for new UI
Co-authored-by: Sarah Edwards <skedwards88@github.com>
Copy file name to clipboardExpand all lines: content/codespaces/codespaces-reference/security-in-codespaces.md
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -48,16 +48,18 @@ An organization's administrators specify which repositories should be considered
48
48
49
49
### Codespace connections
50
50
51
-
You can connect to your codespace using the TLS encrypted tunnel provided by the {% data variables.product.prodname_codespaces %} service. Only the creator of a codespace can connect to a codespace. Connections are authenticated with {% data variables.product.product_name %}.
51
+
You can connect to your codespace using the TLS encrypted tunnel provided by the {% data variables.product.prodname_codespaces %} service. Only the creator of a codespace can connect to a codespace. Connections are authenticated with {% data variables.product.product_name %}.
52
52
53
-
If you need to allow external access to services running on a codespace, you can enable port forwarding for private or public access.
53
+
If you need to allow external access to services running on a codespace, you can enable port forwarding for private or public access.
54
54
55
55
### Port forwarding
56
56
57
57
If you need to connect to a service (such as a development web server) running within your codespace, you can configure port forwarding to make the service available on the internet.
58
58
59
59
**Privately forwarded ports**: Are accessible on the internet, but only the codespace creator can access them, after authenticating to {% data variables.product.product_name %}.
60
60
61
+
**Publicly forwarded ports within your organization**: Are accessible on the internet, but only to members of the same organization as the codespace, after authenticating to {% data variables.product.product_name %}.
62
+
61
63
**Publicly forwarded ports**: Are accessible on the internet, and anyone on the internet can access them. No authentication is needed to access public forwarded ports.
62
64
63
65
All forwarded ports are private by default, which means that you will need to authenticate before you can access the port. Access to a codespace's private forwarded ports is controlled by authentication cookies with a 3-hour expiry period. When the cookie expires, you will need to reauthenticate.
Copy file name to clipboardExpand all lines: content/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace.md
+10-6Lines changed: 10 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -15,8 +15,6 @@ topics:
15
15
shortTitle: Forward ports
16
16
---
17
17
18
-
19
-
20
18
## About forwarded ports
21
19
22
20
Port forwarding gives you access to TCP ports running within your codespace. For example, if you're running a web application on port 4000, you can access the application from your browser to test and debug the application.
@@ -25,7 +23,7 @@ When an application running inside a codespace outputs a port to the console, {%
25
23
26
24

27
25
28
-
You can also forward a port manually, label forwarded ports, share forwarded ports publicly, and add forwarded ports to the codespace configuration.
26
+
You can also forward a port manually, label forwarded ports, share forwarded ports with members of your organization, share forwarded ports publicly, and add forwarded ports to the codespace configuration.
29
27
30
28
## Forwarding a port
31
29
@@ -57,11 +55,17 @@ You can label a port to make the port more easily identifiable in a list.
57
55
58
56
## Sharing a port
59
57
60
-
If you want to share a forwarded port with others, you need to make the port public. After you make a port public, anyone with the port's URL can view the running application without needing to authenticate.
58
+
{% note %}
59
+
60
+
**Note:** You can only make a port private to an organization if your organization uses {% data variables.product.prodname_team %} or {% data variables.product.prodname_ghe_cloud %}. This feature is not currently available in the beta version of {% data variables.product.prodname_codespaces %}.
61
+
62
+
{% endnote %}
63
+
64
+
If you want to share a forwarded port with others, you can either make the port private to your organization or make the port public. After you make a port private to your organization, anyone in the organization with the port's URL can view the running application. After you make a port public, anyone with the port's URL can view the running application without needing to authenticate.
61
65
62
66
{% data reusables.codespaces.navigate-to-ports-tab %}
63
-
1. Right click the port you want to share, then click **Make Public**.
64
-

67
+
1. Right click the port that you want to share, select the "Port Visibility" menu, then click **Private to Organization** or **Public**.
68
+

65
69
1. To the right of the local address for the port, click the copy icon.
66
70

67
71
1. Send the copied URL to the person you want to share the port with.
Copy file name to clipboardExpand all lines: content/codespaces/getting-started/deep-dive.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -68,13 +68,13 @@ When you close or stop your codespace, all uncommitted changes are preserved unt
68
68
69
69
Port forwarding gives you access to TCP ports running within your codespace. For example, if you're running a web application on port 4000 within your codespace, you can automatically forward that port to make the application accessible from your browser.
70
70
71
-
Port forwarding determines which ports are made accessible to you from the remote machine. Even if you do not forward a port, that port is still accessible to other processes running inside the codespace itself.
71
+
Port forwarding determines which ports are made accessible to you from the remote machine. Even if you do not forward a port, that port is still accessible to other processes running inside the codespace itself.
72
72
73
73

74
74
75
75
When an application running inside {% data variables.product.prodname_codespaces %} outputs a port to the console, {% data variables.product.prodname_codespaces %} detects the localhost URL pattern and automatically forwards the port. You can click on the URL in the terminal or in the toast message to open the port in a browser. By default, {% data variables.product.prodname_codespaces %} forwards the port using HTTP. For more information on port forwarding, see "[Forwarding ports in your codespace](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)."
76
76
77
-
While ports can be forwarded automatically, they are not publicly accessible to the internet. By default, all ports are private, but you can [manually make a port public](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace#sharing-a-port) to share access through a URL.
77
+
While ports can be forwarded automatically, they are not publicly accessible to the internet. By default, all ports are private, but you can manually make a port available to your organization or public, and then share access through a URL. For more information, see "[Sharing a port](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace#sharing-a-port)."
78
78
79
79
Running your application when you first land in your codespace can make for a fast inner dev loop. As you edit, your changes are automatically saved and available on your forwarded port. To view changes, go back to the running application tab in your browser and refresh it.
0 commit comments