3 ms·
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 i
by zwieback 14y ago
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 14y agoYour 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 14y agoI 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.
- Evbn 14y agoJS implementation of the API, or JS shim over the system API?