As far as local TCP, I've been working hard on integrating web socket server in the esp8266. It's a fairly simple protocol on top of the initial HTTP handshake and browsers can connect to it no problem. I could help code up support if you wanted to head that direction.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
As far as local TCP, I've been working hard on integrating web socket server in the esp8266. It's a fairly simple protocol on top of the initial HTTP handshake and browsers can connect to it no problem. I could help code up support if you wanted to head that direction.