Hacker News new | past | comments | ask | show | jobs | submit login

Maybe you should use TCP instead of HTTP, but there's a number of reasons to use HTTP as basically TCP:

* Browsers can't speak TCP natively (oddly enough)

* HTTP works through proxies

* Most web frameworks do HTTP more easily, same for web servers

Of course, the real solution here is probably to use websockets or HTTP/2, since then you get all the advantages of HTTP without the downsides of TCP.




> (oddly enough)

That's by design - allowing arbitrary TCP in a browser is just asking for security and DDoS problems.

> HTTP works through proxies

So does TCP (SOCKS).

> Web servers

Using web server wouldn't make sense if you were using straight TCP.

The real reasons HTTP is used when plain TCP would be more appropriate are:

1) Lazy/stupid firewalls configured to only allow port 80/443. This leads to everyone doing everything over HTTP, moving the problem and making the firewall much less useful.

2) NAT. When the primary benefit of the internet - where each peer is equivalent in the protocol - cannot be counted on, centralized servers (usually using HTTP because of #1) are used instead of direct TCP.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: