|
|
Log in / Subscribe / Register

A Linux system running over JavaScript

A Linux system running over JavaScript

Posted May 20, 2011 17:37 UTC (Fri) by Simetrical (guest, #53439)
In reply to: A Linux system running over JavaScript by dag-
Parent article: A Linux system running over JavaScript

JavaScript running as part of a web page doesn't have network access. All it can do is issue HTTP requests, and those only with substantial limitations. E.g., if you even want access to the raw response data, you need to use XMLHttpRequest, which normally only works same-origin (bellard.org can only send requests to bellard.org URLs). Web page JavaScript is never going to be able to use things like SSH to arbitrary hosts: otherwise merely visiting a website would let the owner use your machine for portscanning and so on. If it were ported to be a browser extension instead of just a web page, that might change things, but of course that takes away half the fun.


to post comments

A Linux system running over JavaScript

Posted May 23, 2011 0:15 UTC (Mon) by dag- (guest, #30207) [Link] (3 responses)

Hosting on the server that provides the javascript does not seem like a show-stopper at all. For those people that contemplate using it, tunneling over JSON through some sort of proxy seems useful.

Don't dismiss it straight off...

A Linux system running over JavaScript

Posted May 23, 2011 14:16 UTC (Mon) by Simetrical (guest, #53439) [Link] (2 responses)

What do you propose, tunneling TCP over XMLHttpRequest? XHR requires you to submit the full request up front and doesn't give you the response until it's completely received, so you'd have to create and destroy an entire HTTP session every time you wanted to send or receive a single packet to or from the tunnel. I don't recommend you try running SSH this way -- the latency would likely be insufferable.

This might be feasible once WebSockets is usable again. But it would only work if the server trusts the client not to abuse it as an anonymous proxy. Realistically, as I said, it would be more plausible to write a version that works as a browser extension of some kind, while still being written entirely or almost entirely in JavaScript. Then you could conceivably have real networking access.

A Linux system running over JavaScript

Posted May 26, 2011 18:17 UTC (Thu) by dbarnes (guest, #75204) [Link] (1 responses)

Websockets were revised last month. Is it still not usable? If not, why?

A Linux system running over JavaScript

Posted May 26, 2011 22:23 UTC (Thu) by Simetrical (guest, #53439) [Link]

I meant that it's not usable in production, i.e., in cases where you can't ask users to use a specific browser version or reconfigure the one they use, or where you don't want to rewrite your server every couple of months to keep up with breaking wire protocol changes. It's usable for experimentation, and might be usable for production once multiple browsers implement the current version and leave it enabled by default.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds