Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

You must use Bash as your shell. Because /dev/tcp is a magic provided by Bash.

$ exec 5<>/dev/tcp/{server_host}/{tcp_port}
$ echo '{"jsonrpc":"2.0","id":"1","method":"server.version","params":[]}' >&5; cat <&5

You'll get the result like this.

{"jsonrpc": "2.0", "id": "1", "result": "ElectrumX 1.0.15"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.