Skip to content

Comment on The Emularity

Comments

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?

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

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.