I’ve used Glitch for some experiments in a study I conducted on alternatives for implementing a non-native ProxyCommand for SSH, with a focus on interpreter availability, memory usage overhead, and implementation complexity.
#!/usr/bin/env node
const net = require('net');
const sock = new net.Socket();
sock.connect(xx, 'xxxx', () => {
sock.pipe(process.stdout);
process.stdin.pipe(sock);
});
Really concise! Node has very well-matched abstractions for doing this kind of work.
The exact purpose: I’m writing a ProxyCommand to interact with a relay, which is part of my project for storing Git repositories on a phone: https://gitlab.com/wh0/te. Which is why I compared the overhead to a Git clone operation (:
edit: mistakenly referred to this as a relay. it’s not; the relay is separate. the ProxyCommand interacts with the relay.