

Web Server in your Browser (Chrome Apps API) - kinlan
https://github.com/GoogleChrome/chrome-app-samples/tree/master/webserver

======
Osiris
Opera offered a built-in web server in the application for quite some time
called Unite. You were able to build apps and serve them up to yourself or
friends remotely through your browser.

They just recently removed the feature from the version 12 builds. I think
that it was an interesting concept but it never caught hold.

~~~
Pwnguinz
Yes, quite a shame too, since I used it actively. I'm glad that Chrome will
now be supporting a similar functionality (albeit in a somewhat hackish way
for the time being). Can't wait to see what develops of the new Chrome
networking stack.

Opera will always be my first browser love, though <3!

~~~
kinlan
Would love some feedback on how to make the API less hackish.

------
zwieback
I'm a traditionalist (to me TCP connections use socket API in C) so can
someone put this in context for me:

\- could I write some JS script that runs directly in Chrome that accepts a
socket connection, receives some data, sends responses and displays something
in the browser?

\- could this theoretical app be directly "deployed" from a web page on server
in our LAN?

\- does this solution help with my current situation where I have to help
users poke holes into their McAffee firewall?

Could be useful for me since I frequently send small test utils to my team
that communicate with our embedded systems via socket connections.

~~~
kinlan
Your first point, this is just the JS implementation of the socket API. So
yes, Chrome can accept a connection and send it back.

2nd point, yes, as long as you bind it to your IP address.

3rd point. Honestly not sure.

~~~
th0ma5
I would say probably not on #3 ... however, given the general NAT concept and
such, having an outgoing connection could poke the hole, but this isn't how a
listening service usually works, so it would require something else. However,
once the session is negotiated, then HTTP (in theory) should work, although it
is stateless at that level, but anyway, this is all a lot of bother because at
this point you should go ahead and do something that's less of a kludge since
you're already doing NAT traversal.

------
debacle
The operating system within the operating system.

It's JavaScript all the way down, folks.

~~~
cleverjake
<http://bellard.org/jslinux/>

~~~
reginaldo
Shameless plug: and also <https://github.com/ubercomp/jslm32/> (includes a
mechanism that generates Javascript on the fly).

------
magoon
This is only useful for Chrome Apps (which are meant to run locally on your
machine) and will probably not be enabled for any real web surfing. Hosting
HTTP on port 80 is probably the least useful real-world sample for this
capability.

~~~
kinlan
I selected a web server, because a lot of web developers want to run localhost
test environments easily and also on Chrome OS.

------
dotborg
Ideas like crowdsourced distributed hosting now come to my mind :)

~~~
mw63214
I wonder if also using a sandboxed localstorage as a memcached would be
useful? I guess you would have to account for bandwidth, response time, and
available memory. Also account for variable CPU usage, but I wonder if you
could train an algorithm to account for these factors. I could see it being a
great way to "get paid for using X Extension".

------
fungi
[https://addons.mozilla.org/en-US/firefox/addon/pow-plain-
old...](https://addons.mozilla.org/en-US/firefox/addon/pow-plain-old-
webserver/) (apparently discontinued)

[https://addons.mozilla.org/en-US/firefox/addon/browser-
serve...](https://addons.mozilla.org/en-US/firefox/addon/browser-server/) (not
tagged to work on linux :\\)

------
heyrhett
Firewalls are going to impede this from being used for widespread p2p apps. Is
there a practical way to do UDP/TCP hole punching ala skype?

~~~
pygy_
<http://samy.pl/pwnat/> allows to establish a bidirectional connection between
two machines behind NATs, but one of them must know the IP of the other's NAT,
so this still requires a peer discovery system.

Also, I don't know if Chrome's socket API is sufficiently low level to craft
ICMP packets. If I understand properly, it only offers a TCP socket.

~~~
kinlan
We can't do ICMP. Only TCP and UDP

------
aashu_dwivedi
now can i have a rhythm-box,nautilus ..all running inside my browser :D !!

