Skip to content

docker behind nginx , websockify forwarding to docker to enable sound #262

Answered by toomyzoom
Akatsuki-Ryu asked this question in Q&A
Discussion options

You must be logged in to vote

So the main VNC server (noVNC) uses websocket library (websock.js) to connect. It uses this._url, which is whatever your current address, e.g.: wss://<domain>:443/firefox/websockify
The audio call for connecting is in noVNC (app/ui.js), in this function: connectWebSocket()

function connectWebSocket() {
  var socketURL = (window.location.protocol == 'https:' ? 'wss:' : 'ws:')+'//'+document.location.hostname+':'+window.location.port+'/websockify-audio';
  ...
  UI.audioContext.webSocket = new WebSocket(socketURL, ['binary']);

It hardcoded the url as document.location.hostname+':'+window.location.port+'/websockify-audio' so we get wss://<domain>:443/websockify-audio instead of wss://<domain…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@Akatsuki-Ryu
Comment options

Answer selected by Akatsuki-Ryu
Comment options

You must be logged in to vote
1 reply
@Akatsuki-Ryu
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants