News for hackers. Stuff that matters.
Re:WebTCP: Making TCP Connections From Browser by chewxy on Wednesday November 28, 2012 @05:45PM (#4845209)
So, TCP over HTTP, which is a protocol built on top of TCP. Does anyone see that this is rather silly?

If you want a client-side app that uses TCP, why must you do it over the web? The appeal of write-once-run-everywhere?

Re:WebTCP: Making TCP Connections From Browser by sneak on Wednesday November 28, 2012 @06:36PM (#4845449)
It's not TCP over HTTP, that would require a TCP stack. It's the io bytestream from a specific TCP connection, shuttled over HTTP.

It's not entirely bogus, just mostly so. I really dislike this whole "the internet == the web" way of thinking, though.

Re:WebTCP: Making TCP Connections From Browser by javajosh on Thursday November 29, 2012 @12:01AM (#4846347)
On the contrary, this sort of things allows us to write clients in a uniform way. It will be nice to be able to debug the redis client in a jsfiddle. :)
Re:WebTCP: Making TCP Connections From Browser by sneak on Thursday November 29, 2012 @12:36PM (#4848977)
By this argument, "uniformity" means we should then port the linux kernel to javascript so that we can debug it in jsfiddle.

Down that path lies madness.

Re:WebTCP: Making TCP Connections From Browser by javajosh on Thursday November 29, 2012 @03:07PM (#4849956)
What's wrong with writing a kernel in JavaScript? This would actually be quite valuable as a pedagogical tool.
Re:WebTCP: Making TCP Connections From Browser by icebraining on Wednesday November 28, 2012 @06:39PM (#4845462)
It uses Websockets, which are only HTTP for the handshake: the rest of the connection is just a TCP stream.

So it's really more like a NAT bridge.

Re:WebTCP: Making TCP Connections From Browser by khakimov on Wednesday November 28, 2012 @05:59PM (#4845282)
it's not about pure tcp, as i get it - it allows you communicate from browser directly (via webtcp server as a bridge) with any servers such as redis, mongodb, rabbitmq and so on.

WebBrowser --- data ---> WebTCP bridge (translate data to servers) --- data ---> redis/rabbitmq/any_tcp(and i think udp also possible?)_server_even_smtp

Re:WebTCP: Making TCP Connections From Browser by yankoff on Wednesday November 28, 2012 @05:48PM (#4845225)
Well, you didn't read the post apparently and only a title :(
Re:WebTCP: Making TCP Connections From Browser by chewxy on Wednesday November 28, 2012 @05:53PM (#4845251)
I actually did. I was quite interested in the redis example. For about 10 seconds, which I then went "wtf is this useful for?"

We really need to stop reinventing the wheel

Re:WebTCP: Making TCP Connections From Browser by yankoff on Wednesday November 28, 2012 @05:54PM (#4845258)
What would you use to achieve the same thing with Redis?
Re:WebTCP: Making TCP Connections From Browser by sebastianmck on Wednesday November 28, 2012 @06:01PM (#4845294)
Re:WebTCP: Making TCP Connections From Browser by lttlrck on Wednesday November 28, 2012 @06:43PM (#4845484)
REST is far more appropriate for databases.

Pub/sub is well catered for by socket.io (websockets).

This glue belongs on the server.

If I did need arbitrary TCP connections my first thought would be a websocket proxy...

Re:WebTCP: Making TCP Connections From Browser by chewxy on Wednesday November 28, 2012 @06:03PM (#4845301)
I wouldn't. I'd make a HTTP call to the server, and let the server handle it. (i.e. your "what's so different from the backend method")?
Re:WebTCP: Making TCP Connections From Browser by yankoff on Wednesday November 28, 2012 @06:12PM (#4845342)
Yep, and i wrote about differences to such approach in the post. Don't get me wrong, this is definitely a hack, I'm not saying people should stop doing it the old way.
Re:WebTCP: Making TCP Connections From Browser by chewxy on Wednesday November 28, 2012 @06:15PM (#4845354)
Likewise. While I appreciate the concept of a bridge (I'm a strong believer that the fastest app is the app that does practically nothing at all, and I can see the benefit of using a TCP-bridge like thing to make something faster), I just think we should not be reinventing the wheel.

That is to say, if you need a TCP connection to any server, you probably should not be implementing it over HTTP (well, this is where definitions get difficult, since you know, HTTP is technically TCP. Fuck)