开发者

Can clients using http 1.0 or older use UDP sockets instead of TCP sockets?

开发者 https://www.devze.com 2022-12-26 23:38 出处:网络
Can clients using http 1.0 or older use UDP sockets instead of TCP sockets? I was wondering as to what could prevent such use apart from firewall issues and packet size limitations.开发者_如何学Pytho

Can clients using http 1.0 or older use UDP sockets instead of TCP sockets?

I was wondering as to what could prevent such use apart from firewall issues and packet size limitations.开发者_如何学Python However, if that isn't a problem, is there anything else that prevents such use.

Also, have they been used traditionally?


From RFC 1945, "Hypertext Transfer Protocol -- HTTP/1.0", section 1.3, "Overall Operation":

On the Internet, HTTP communication generally takes place over TCP/IP connections. The default port is TCP 80 [15], but other ports can be used. This does not preclude HTTP from being implemented on top of any other protocol on the Internet, or on other networks. HTTP only presumes a reliable transport; any protocol that provides such guarantees can be used, and the mapping of the HTTP/1.0 request and response structures onto the transport data units of the protocol in question is outside the scope of this specification.

So, if you can implement a reliable transport over UDP then you can use HTTP. Of course, at that point you may as well use TCP instead of abusing datagrams.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号