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
+21-17Lines changed: 21 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -84,31 +84,24 @@ 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.
102
-
103
-
### Authentication
96
+
#### Authentication
104
97
105
98
Since forwarded ports are private, cross-origin requests must include
106
99
credentials (set `credentials: "include"` if using `fetch`) or the requests
107
100
cannot be authenticated and you will see an error resembling the following:
108
101
109
102
> 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
103
111
-
### Headers
104
+
####Headers
112
105
113
106
Below is a list of the cross-origin headers Coder sets with example values:
114
107
@@ -126,7 +119,7 @@ The allowed origin will be set to the origin provided by the browser if the
126
119
users are identical. Credentials are allowed and the allowed methods and headers
127
120
will echo whatever the request sends.
128
121
129
-
### Configuration
122
+
####Configuration
130
123
131
124
These cross-origin headers are not configurable by administrative settings.
132
125
@@ -136,7 +129,7 @@ applications and thus cannot be modified by them. Read more about the difference
136
129
between simple requests and requests that trigger preflights
0 commit comments