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
Copy file name to clipboardExpand all lines: docs/networking/port-forwarding.md
+29-23Lines changed: 29 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -84,31 +84,25 @@ Valid `share` values include `owner` - private to the user, `authenticated` - ac
84
84
85
85

86
86
87
-
##SSH
87
+
### Cross-origin resource sharing (CORS)
88
88
89
-
First, [configure SSH](../ides.md#ssh-configuration) on your
90
-
local machine. Then, use `ssh`to forward like so:
89
+
When forwarding via the dashboard, Coder automatically sets headers that allow
90
+
requests between separately forwarded applications belonging to the same user.
91
91
92
-
```console
93
-
ssh -L 8080:localhost:8000 coder.myworkspace
94
-
```
92
+
When forwarding through other methods the application itself will need to set
93
+
its own CORS headers if they are being forwarded through different origins since
94
+
Coder does not intercept these cases. See below for the required headers.
95
95
96
-
You can read more on SSH port forwarding [here](https://www.ssh.com/academy/ssh/tunneling/example).
97
-
98
-
## Cross-origin resource sharing (CORS)
99
-
100
-
Coder automatically sets headers that allow requests between separately
101
-
forwarded applications belonging to the same user.
96
+
#### Authentication
102
97
103
-
### Authentication
104
-
105
-
Since forwarded ports are private, cross-origin requests must include
106
-
credentials (set `credentials: "include"` if using `fetch`) or the requests
107
-
cannot be authenticated and you will see an error resembling the following:
98
+
Since ports forwarded through the dashboard are private, cross-origin requests
99
+
must include credentials (set `credentials: "include"` if using `fetch`) or the
100
+
requests cannot be authenticated and you will see an error resembling the
101
+
following:
108
102
109
103
> Access to fetch at 'https://dev.coder.com/api/v2/applications/auth-redirect' from origin 'https://8000--dev--user--apps.dev.coder.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
110
104
111
-
### Headers
105
+
####Headers
112
106
113
107
Below is a list of the cross-origin headers Coder sets with example values:
114
108
@@ -126,17 +120,18 @@ The allowed origin will be set to the origin provided by the browser if the
126
120
users are identical. Credentials are allowed and the allowed methods and headers
127
121
will echo whatever the request sends.
128
122
129
-
### Configuration
123
+
####Configuration
130
124
131
125
These cross-origin headers are not configurable by administrative settings.
132
126
133
127
Applications can set their own headers which will override the defaults but this
134
-
will only apply to non-preflight requests. Preflight requests are never sent to
135
-
applications and thus cannot be modified by them. Read more about the difference
136
-
between simple requests and requests that trigger preflights
128
+
will only apply to non-preflight requests. Preflight requests through the
129
+
dashboard are never sent to applications and thus cannot be modified by
130
+
them. Read more about the difference between simple requests and requests that
0 commit comments