Does anyone know of any resources (maybe a code example) for establishing a webrtc peer connection between a browser and an arbitrary service?
There is this issue which is being worked on at the moment in the node-webrtc library:
https://github.com/js-platform/node-webrtc
Once that's resolved data channel connectivity between a browser and command-line app, server, etc should be reasonably simple. While this bug is outstanding, it is possible to fall back to Rtp data channels in the browser and if that is something that is of interest then we can look at putting together some examples with rtc.io if that would help you out.