2

我正在尝试编写自己的网络聊天服务界面。唯一的问题是,我无法理解来自服务器的返回。与服务器的通信很容易解码,但我想知道服务器响应是否以某种方式加密/压缩。包头将结果指定为“application/json”。

使用 fiddler2,我从服务器截获了以下 http 包:

vS1gN7zSnVkl7tP4+ygk4f0uJWxWH532dgLhMxYMh8dFCNfyHrkiPCtjS+TPzryHBECM3pVv90GgNI9xkLKNjR9pQ0PUpHAL2TAmRmxSbHCwmEwbDJ2WLLwMwIXdeaQWgbIxfZG5wkdH58JHqwf2FxCaGrVTidkeUDKdCBEZtnpXUoKUizpxzPB+r4KeTTc3vIMk/x/1LbIgumVWq0HEnHFGnYk2Dy1PjfiSJ+MdTus=

查看代码的类型,我认为它是 base64 编码的。使用 python 我运行简单的命令:

import base64
print base64.decodestring("string above")

但它只会返回乱码。将 repr() 添加到上述结果中,它会返回:

'\xbd-`7\xbc\xd2\x9dY%\xee\xd3\xf8\xfb($\xe1\xfd.%lV\x1f\x9d\xf6v\x02\xe13\x16\x0c\x87\xc7E\x08\xd7\xf2\x1e\xb9"<+cK\xe4\xcf\xce\xbc\x87\x04@\x8c\xde\x95o\xf7A\xa04\x8fq\x90\xb2\x8d\x8d\x1fiCC\xd4\xa4p\x0b\xd90&FlRlp\xb0\x98L\x1b\x0c\x9d\x96,\xbc\x0c\xc0\x85\xddy\xa4\x16\x81\xb21}\x91\xb9\xc2GG\xe7\xc2G\xab\x07\xf6\x17\x10\x9a\x1a\xb5S\x89\xd9\x1eP2\x9d\x08\x11\x19\xb6zWR\x82\x94\x8b:q\xcc\xf0~\xaf\x82\x9eM77\xbc\x83$\xff\x1f\xf5-\xb2 \xbaeV\xabA\xc4\x9cqF\x9d\x896\x0f-O\x8d\xf8\x92\'\xe3\x1dN\xeb'

我已经尝试通过各种版本的 unicode 和其他编码方案来解析它,但我无法理解它。有人对我如何进行有任何想法吗?


编辑:更多示例:

vS1gN7zSnVkl7tP4+ygk4f0uJWxWH532dgLhMxYMh8ft9/EeuejyE/5QCnFgra+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