1

I'm trying to build a simple in-browser shell using Docker and xterm.js. I've correctly hooked up the frontend using xterm.js's attach addon.

How does one connect to Docker via websockets?

Will
  • 1,171
  • 2
  • 14
  • 26
  • What happens when you use the demo code from the application? – Matt Jan 28 '18 at 03:23
  • I can use the demo code to hook up to a "wss://..." endpoint correctly. (I verified with echo.websockets.org.) But I don't know how to set up docker to serve from the endpoint. – Will Jan 28 '18 at 22:05

1 Answers1

3

If you are using a Docker API >= 1.28, you cannot connect straight to it with xterm.js, since Docker changed their WebSocket protocol from text to binary .

There is an open xterm.js issue for that: https://github.com/xtermjs/xterm.js/issues/883.

Paris
  • 6,323
  • 7
  • 31
  • 49