Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

code-server on docker container in synology nas #7067

Answered by code-asher
dimagenius asked this question in Q&A
Discussion options

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

You must be logged in to vote

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

Comment options

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.

You must be logged in to vote
1 reply
Comment options

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.

Thanks is worked for me - wss://myDomain/proxy/8080/ws

Answer selected by code-asher
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /