如果处理客户端请求的服务器在发送响应之前终止,代理服务器应该向客户端发送什么响应?

时间:2018-08-03 17:39:49

标签: http

[client] ---> [proxy] ---> [remote server]
  1. 客户端通过代理向远程服务器发送了一个请求。
  2. 远程服务器接受了连接,但是在产生响应之前终止了连接。

应该怎么回答?

中,默认行为是产生500状态代码和“套接字挂断”错误消息,例如

curl --proxy http://127.0.0.1:8000 http://127.0.0.1:8090 -v
* Rebuilt URL to: http://127.0.0.1:8090/
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8000 (#0)
> GET http://127.0.0.1:8090/ HTTP/1.1
> Host: 127.0.0.1:8090
> User-Agent: curl/7.54.0
> Accept: */*
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 500 Internal Server Error
< x-raygun-request-id: 01CM0DWC030AJWJDE5YN5EJK2E
< Date: Fri, 03 Aug 2018 17:38:07 GMT
< Connection: keep-alive
< Transfer-Encoding: chunked
<
* Connection #0 to host 127.0.0.1 left intact
socket hang up

但是,后者掩盖了多种可能的故障。

0 个答案:

没有答案