GetFileUploadInfoResponse rsp;
try {
RuntimeOptions runtimeOptions = new RuntimeOptions();
// 设置代理
// String url = "http://192.168.0.15:9028/api";
// runtimeOptions.setHttpProxy(url);
rsp = storageClient1.getFileUploadInfoWithOptions(
getSpaceId(),
new GetFileUploadInfoRequest()
.setUnionId(getUser(null).getUnionid())
.setProtocol("HEADER_SIGNATURE")
.setMultipart(false),
new GetFileUploadInfoHeaders().setXAcsDingtalkAccessToken(getAccessToken()),
runtimeOptions
);
} catch (Exception e) {
log.error("钉盘-获取文件上传信息 异常: ", e);
throw new ServiceException("钉盘-获取文件上传信息 异常: " + e.getMessage());
}
com.aliyun.dingtalkstorage_1_0.models.GetFileUploadInfoResponseBody fileInfo = rsp.getBody();
return fileInfo;
} 这里一设置代理就错误:com.aliyun.tea.TeaUnretryableException: Unexpected response code for CONNECT: 400
at com.aliyun.teaopenapi.Client.execute(Client.java:1183) 其中 192.168.0.15 中的 nginx 配置:server{
listen 9028;
server_name localhost;
location /api {
proxy_pass https://api.dingtalk.com/;
proxy_connect_timeout 60;
proxy_read_timeout 60;
proxy_send_timeout 60;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host 'api.dingtalk.com';
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}
location / {
proxy_pass https://oapi.dingtalk.com/;
proxy_connect_timeout 60;
proxy_read_timeout 60;
proxy_send_timeout 60;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host 'oapi.dingtalk.com';
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}
} 下面是 nginx access.log -->> 192.168.0.69 - - [19/Dec/2024:10:24:15 +0800] "CONNECT api.dingtalk.com:443 HTTP/1.1" 400 157 "-" "-" 现在是想知道怎么在 RuntimeOptions 这里面设置正确的代理,官方文档翻了又翻,确实没有相关介绍,求助各位大佬给予帮助,立正感谢