收到gzip数据时反向代理错误

时间:2015-11-29 16:01:12

标签: c# sockets

当我收到gzip数据并将其转发给客户端时,我已经在C#中创建了一个反向代理,它似乎并不理解它。

The webpage at http://m.agar.io/findServer might be temporarily down or it may have moved permanently to a new web address.

服务器发送:

[tcpFowarderStream] >> HTTP/1.1 200 OK
Date: Sun, 29 Nov 2015 15:39:40 GMT
Content-Type: text/plain
Transfer-Encoding: chunked
Connection: keep-alive
Access-Control-Allow-Origin: http://agar.io
Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS
Server: cloudflare-nginx
CF-RAY: 24cf6816767d34ee-LHR
Content-Encoding: gzip

79
▼      ♥?V?,P?R245??0????35?2450R?Q*??N?S?RJ?(?
2(t??M4.1Jt????()K?)?I?34M?((♀2???t?
??L?????p3N3??N1??N?0?T?♣   ??

[tcpFowarderStream] >> a
♥ ??e`i
0

有人可以解释为什么会发生这种情况并帮助提供解决方案吗?它适用于其他网站只有这个网站搞砸了。

没有代理的回复:

HTTP/1.1 200 OK
Date: Sun, 29 Nov 2015 17:03:20 GMT
Content-Type: text/plain
Transfer-Encoding: chunked
Connection: keep-alive
Access-Control-Allow-Origin: http://agar.io
Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS
Server: cloudflare-nginx
CF-RAY: 24cfe2aa70ea34b2-LHR
Content-Encoding: gzip

79
        V ,P R245Գ0г  37 2450R Q*  N S RJ ( 
2( t  M4 1Nt ȉ ()K ) I 34M ((2 ˶t 
  L  Ȏ p3N3  L  M H T      
a
 7~Y(i   
0

1 个答案:

答案 0 :(得分:1)

我将其更改为使用Encoding.Default。