Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Web Server in your Browser (Chrome Apps API) (github.com/googlechrome)
54 points by kinlan on Oct 9, 2012 | hide | past | favorite | 24 comments


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.


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!


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


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.


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.


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.


JS implementation of the API, or JS shim over the system API?


The operating system within the operating system.

It's JavaScript all the way down, folks.



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


When do we get to get rid of everything else?


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.


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


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


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".


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?



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.


We can't do ICMP. Only TCP and UDP


As a matter of fact you don't need socket API or webRTC or whatsoever, Chrome has established an XMPP and jingle p2p connection for sync bookmarks, etc. It's not open API for Javascript yet, but I defintely see the potential.


How do apps like bit torrent do it today?


  Universal Plug and Play
  Manual Rule Adding
  Third Party Server



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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: