Skip to content

Can xterm be used to connect devices via tcp instead of WebSocket? #4751

Answered by jerch
dbssAlan asked this question in Q&A
Discussion options

You must be logged in to vote

It depends on how you set up your electron client:

JS in a browser context normally has no access to raw TCP sockets, it needs some sort of HTTP wrapping (either by Ajax/long polling or via websockets). Thats the reason why its often done with websockets.

But with electron the situation changes - you can either use the electron client process as proxy to translate between TCP and the browser context (again forward data with websockets or with IPC), or allow the browser context to load nodejs modules and hook TCP handling in there directly (via the net module).

In the end this is more an electron question than xterm.js related. To get data into xterm.js you only have to feed it to term.write

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dbssAlan
Comment options

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