@@ -60,18 +60,9 @@ For more examples, see `coder port-forward --help`.
60
60
> name, agent name, workspace name and username exceed 63 characters in the
61
61
> hostname, port forwarding via the dashboard will not work.
62
62
63
- ### From an arbitrary port
64
-
65
- One way to port forward in the dashboard is to use the "Port forward" button to
66
- specify an arbitrary port. Coder will also detect if apps inside the workspace
67
- are listening on ports, and list them below the port input (this is only
68
- supported on Windows and Linux workspace agents).
69
-
70
- ![ Port forwarding in the UI] ( ../images/port-forward-dashboard.png )
71
-
72
63
### From an coder_app resource
73
64
74
- Another way to port forward is to configure a ` coder_app ` resource in the
65
+ One way to port forward is to configure a ` coder_app ` resource in the
75
66
workspace's template. This approach shows a visual application icon in the
76
67
dashboard. See the following ` coder_app ` example for a Node React app and note
77
68
the ` subdomain ` and ` share ` settings:
@@ -99,7 +90,68 @@ Valid `share` values include `owner` - private to the user, `authenticated` -
99
90
accessible by any user authenticated to the Coder deployment, and ` public ` -
100
91
accessible by users outside of the Coder deployment.
101
92
102
- ![ Port forwarding from an app in the UI] ( ../images/coderapp-port-forward.png )
93
+ ![ Port forwarding from an app in the UI] ( ../images/networking/portforwarddashboard.png )
94
+
95
+ ## Accessing workspace ports
96
+
97
+ Another way to port forward in the dashboard is to use the "Open Ports" button
98
+ to specify an arbitrary port. Coder will also detect if apps inside the
99
+ workspace are listening on ports, and list them below the port input (this is
100
+ only supported on Windows and Linux workspace agents).
101
+
102
+ ![ Port forwarding in the UI] ( ../images/networking/listeningports.png )
103
+
104
+ ### Sharing ports
105
+
106
+ We allow developers to share ports as URLs, either with other authenticated
107
+ coder users or publicly. Using the open ports interface, developers can assign a
108
+ sharing levels that match our ` coder_app ` ’s share option in
109
+ [ Coder terraform provider] ( https://registry.terraform.io/providers/coder/coder/latest/docs/resources/app#share ) .
110
+
111
+ - ` owner ` (Default): The implicit sharing level for all listening ports, only
112
+ visible to the workspace owner
113
+ - ` authenticated ` : Accessible by other authenticated Coder users on the same
114
+ deployment.
115
+ - ` public ` : Accessible by any user with the associated URL.
116
+
117
+ Once a port is shared at either ` authenticated ` or ` public ` levels, it will stay
118
+ pinned in the open ports UI for better accessibility regardless of whether or
119
+ not it is still accessible.
120
+
121
+ ![ Annotated port controls in the UI] ( ../images/networking/annotatedports.png )
122
+
123
+ This can also be used to change the sharing level of ` coder_app ` s by entering
124
+ their port number in the shared ports UI. The ` share ` attribute of ` coder_app ` s
125
+ defined using the terraform provider can be overridden by sharing the port. The
126
+ sharing level is limited by the maximum level enforced by the template in
127
+ enterprise deployments, and not restricted in OSS deployments.
128
+
129
+ ### Configure maximum port sharing level (enterprise)
130
+
131
+ Enterprise-licensed template admins can control the maximum port sharing level
132
+ for workspaces under a given template in the template settings. By default, the
133
+ maximum sharing level is set to ` Owner ` , meaning port sharing is disabled for
134
+ end-users. OSS deployments allow all workspaces to share ports at both the
135
+ ` authenticated ` and ` public ` levels.
136
+
137
+ ![ Max port sharing level in the UI] ( ../images/networking/portsharingmax.png )
138
+
139
+ ### Configuring port protocol
140
+
141
+ Both listening and shared ports can be configured to use either ` HTTP ` or
142
+ ` HTTPS ` to connect to the port. For listening ports the protocol selector
143
+ applies to any port you input or select from the menu. Shared ports have
144
+ protocol configuration for each shared port individually.
145
+
146
+ You can access any port on the workspace and can configure the port protocol
147
+ manually by appending a ` s ` to the port in the URL.
148
+
149
+ ```
150
+ # Uses HTTP
151
+ https://33295--agent--workspace--user--apps.example.com/
152
+ # Uses HTTPS
153
+ https://33295s--agent--workspace--user--apps.example.com/
154
+ ```
103
155
104
156
### Cross-origin resource sharing (CORS)
105
157
0 commit comments