5 ms·
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 t
by arohner 12y 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?
- petercooper 12y agoNo, 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 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 https://developer.chrome.com/apps/app_network
- arohner 12y agoBut websockets doesn't give you raw tcp, right? Do they have a proxy somewhere?
- spion 12y agoWell, one way is to implement TCP over HTTP (or some of the lower-level protocols even) but you will need server-side code aswell