tunnel-server http api: /proxy/{agentId}/**默认为get问题
licekits opened this issue · comments
Li Ke commented
- 我已经在 issues 里搜索,没有重复的issue。
环境信息
arthas-boot.jar
或者as.sh
的版本: 3.6.8- Arthas 版本: 3.6.8
- 操作系统版本: windows 11
- 目标进程的JVM版本: xxx
- 执行
arthas-boot
的版本: 3.7.2
重现问题的步骤
- 192.168.100.21启动tunnel-server: java -Dserver.port=8080 -jar arthas-tunnel-server-3.6.8-fatjar.jar
- 192.168.100.31启动一个java应用,并注册到1的tunnel-server(agentId: aaaa):
/root/tools/jdk1.8.0_341/bin/java -jar arthas-boot.jar 2332933 --tunnel-server 'ws://192.168.100.21:7777/ws' --agent-id 192.168.100.31 --password abc123 - 通过代理接口执行session命令,postman--POST方式:
http://192.168.100.21:8080/proxy/192.168.100.31/api
{"command": "session","action": "exec"}
期望的结果
与直接连接的Http 8563服务返回一致。
实际运行的结果
- 返回接口请求不应该为GET:Unsupported http method: GET
2.修改com.alibaba.arthas.tunnel.client的query方法, HttpMethod.GET-->HttpMethod.POST
#72 HttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST, targetUrl,Unpooled.EMPTY_BUFFER);
返回:
{
"message": "Process request error: parse request failed: request body is empty",
"state": "FAILED"
}
问题或建议
- tunnel-server上的proxy接口,是代理到agent上实现其restful api接口一样的功能么?如果是,文档里面请给点说明,包括请求数据结构和授权(我这上面的例子把接口请求授权屏蔽了)。
Li Ke commented
这里为何是Unpooled.EMPTY_BUFFER? 接口的数据怎么传?