@@ -226,25 +226,28 @@ However many people prefer the cleaner aesthetic of no trailing slashes. This co
226
226
to the base path as you cannot use relative redirects correctly anymore. See the above
227
227
link.
228
228
229
- For users who are ok with this tradeoff, pass `--proxy-path-passthrough` to code-server
230
- and the path will be passed as is.
229
+ For users who are ok with this tradeoff, use `/absproxy` instead and the path will be
230
+ passed as is. e.g. `/absproxy/3000/my-app-path`
231
231
232
- This is particularly a problem with the `start` script in create-react-app. See
232
+ ### Proxying to Create React App
233
+
234
+ You must use `/absproxy/<port>` instead with create-react-app.
235
+ See [#2565](https://github.com/cdr/code-server/issues/2565) and
233
236
[#2222](https://github.com/cdr/code-server/issues/2222). You will need to inform
234
- create-react-app of the path at which you are serving via `homepage` field in your
235
- `package.json`. e.g. you'd add the following for the default CRA port:
237
+ create-react-app of the path at which you are serving via `$PUBLIC_URL` and webpack
238
+ via `WDS_SOCKET_PATH`.
236
239
237
- ```json
238
- "homepage": "/proxy/3000",
240
+ e.g.
241
+
242
+ ```sh
243
+ PUBLIC_URL=/absproxy/3000 \
244
+ WDS_SOCKET_PATH=/absproxy/3000/sockjs-node \
245
+ BROWSER=none yarn start
239
246
```
240
247
241
- Then visit ` https://my-code-server-address.io/proxy /3000 ` to see your app exposed through
248
+ Then visit ` https://my-code-server-address.io/absproxy /3000 ` to see your app exposed through
242
249
code-server!
243
250
244
- Unfortunately ` webpack-dev-server ` 's websocket connections will not go through as it
245
- always uses ` /sockjs-node ` . So hot reloading will not work until the ` create-react-app `
246
- team fix this bug.
247
-
248
251
Highly recommend using the subdomain approach instead to avoid this class of issue.
249
252
250
253
## Multi-tenancy
0 commit comments