基于Workerman的一个HTTP转发功能镜像,提供HTTP请求的暂存和转发
WORKER_COUNT=10 #默认10个worker进程,可以根据需要调整
注意请求一定是 content-type:application/json 类型的POST请求
POST体
{"url":"http://e.epplink.net/lock/index.php","data":"{"op":"add","reason":"add a new record","task":"this is the detail task"}","callback_url": "http://e.exxxxxxink.et/lock/index.php"}
url: 转发的URL,要求此url返回 {"code":"1"} 否则会认为任务失败 data: 要转发的内容 callback_url: 如果任务完成需要被通知则填写回调URL(可空),回调内容和下面的查询接口查询到的内容相同
返回
{"code":"1","reason":"success","taskid":"3108"} taskid 表示这个任务的id可以用于查询任务状态
查询某个任务的完成状态(完成的任务默认保留1个小时)包括任务完成情况,以及时间相关信息 http://ipv6center.org:9900/api/task_query?taskid=1732
返回:
{"code":"1","reason":"query success","data":{"taskid":"2535","status":"-5","reason":"Remote server has no response","timestamp_add":"1558056072","timestamp_done":"1558056072"}}
http://ipv6center.org:9900/api/service_status 返回内容
{"task_total":"4000","task_finished":"4000","task_failed":"1996","task_success":2004}
Content type
Image
Digest
Size
68.2 MB
Last updated
about 7 years ago
docker pull forgaoqiang/http_forwarder