Hacker News new | ask | show | jobs
by arohner 4158 days ago
Ok, I understand how you'd run a CPU emulator written in JS, in a browser, but how do these things get raw socket access?

If you're running in a browser, all the network access you get is HTTP AJAX, right?

2 comments

No, there are various other mechanisms now, perhaps the most useful and widespread for this situation being WebSocket. It's not without limitations though: http://en.wikipedia.org/wiki/WebSocket

And it's not quite "the browser" in the usual sense, but Chrome Apps (and, I believe, extensions?) get access to TCP and UDP APIs: https://developer.chrome.com/apps/app_network

But websockets doesn't give you raw tcp, right? Do they have a proxy somewhere?
Not really a proxy - it's pppd in Linux with a vty redirected to a socket. More like a cloud-based dialup ISP that tunnels over existing connections than a proxy.
Yes, the article states they have a proxy.
Well, one way is to implement TCP over HTTP (or some of the lower-level protocols even) but you will need server-side code aswell