-
Notifications
You must be signed in to change notification settings - Fork 6.3k
code-server on docker container in synology nas #7067
-
Hi guys, sorry for my English, I'm using a translator.
I installed on my Synology nas in docker container - code-server (i hav my domain name and static ip).
this is my compose.yaml for install in docker
#services:
code-server:
image: lscr.io/linuxserver/code-server:latest
container_name: codeserver
#environment:
- PUID=#
- PGID=#
- TZ=#
- PASSWORD=#
- SUDO_PASSWORD=#
volumes:
- /volume1/docker/codeserver:/config
ports:
- 8443:8443
restart: unless-stopped
code-server work both on the local network and from outside using my domain name, there are no problems with that (Let's Encrypt certificate available)
Then I installed it in the environment code-server: nodejs+npm+vue cli.
Then with the command in code-server terminal - vue create app I installed Vue2
Vue CLI v5.0.8
? Please pick a preset:
Default ([Vue 3] babel, eslint)
❯ Default ([Vue 2] babel, eslint)
Manually select features
but when I try to run the project with the command (sudo npm run serve, by url (https://myDomain/proxy/8080/)) I see an error in the browser - Invalid Host header.
I changed the file vue.config.js:
module.exports = {
publicPath: "./",
productionSourceMap: false,
devServer: {
allowedHosts: ['myDomain'], -- MY ADD
headers: {
'Access-Control-Allow-Origin': '*',
}
},
transpileDependencies: true
}
I saw the project in the browser, but with an error(
Unexpected token 'o', "[object Blob]" is not valid JSON
SyntaxError: Unexpected token 'o', "[object Blob]" is not valid JSON
at JSON.parse ()
at eval (webpack-internal:///./node_modules/webpack-dev-server/client/socket.js:67:24)
at client.onmessage (webpack-internal:///./node_modules/webpack-dev-server/client/clients/WebSocketClient.js:81:9)
)
Then I changed the file vue.config.js on:
module.exports = {
publicPath: "./",
productionSourceMap: false,
devServer: {
allowedHosts: ['MyDomain],
headers: {
'Access-Control-Allow-Origin': '*',
},
client: {
webSocketURL: 'auto://0.0.0.0:8080/ws', --MY ADD
},
},
transpileDependencies: true
}
After this I see the page without errors, but there is an error in the browser console:
WebSocketClient.js:13 WebSocket connection to 'wss://myDomain:8080/ws' failed: Error in connection establishment: net::ERR_SSL_PROTOCOL_ERROR.
WebSocketClient refuses to work and therefore HOT RELOAD also...
p.s: I understand that the conflict is somewhere in the ports, and synology nas has its own nginx.
Thanks for understanding).
please help
Beta Was this translation helpful? Give feedback.
All reactions
ERR_SSL_PROTOCOL_ERROR seems to imply your browser does not trust your TLS certificate or maybe more likely one is not being served or has issues, but if you are using Let's Encrypt then it seems like it should work.
Although...is wss://myDomain:8080/ws the right address? I would expect something like wss://myDomain/proxy/8080/ws.
Replies: 1 comment 1 reply
-
ERR_SSL_PROTOCOL_ERROR seems to imply your browser does not trust your TLS certificate or maybe more likely one is not being served or has issues, but if you are using Let's Encrypt then it seems like it should work.
Although...is wss://myDomain:8080/ws the right address? I would expect something like wss://myDomain/proxy/8080/ws.
Beta Was this translation helpful? Give feedback.
All reactions
-
ERR_SSL_PROTOCOL_ERRORseems to imply your browser does not trust your TLS certificate or maybe more likely one is not being served or has issues, but if you are using Let's Encrypt then it seems like it should work.Although...is
wss://myDomain:8080/wsthe right address? I would expect something likewss://myDomain/proxy/8080/ws.
Thanks is worked for me - wss://myDomain/proxy/8080/ws
Beta Was this translation helpful? Give feedback.
All reactions
-
🎉 1