|
|
|
@ -55,6 +55,11 @@ public class TunnelClient {
|
|
|
|
|
// agent id, generated by tunnel server. if reconnect, reuse the id
|
|
|
|
|
volatile private String id;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* arthas version
|
|
|
|
|
*/
|
|
|
|
|
private String version = "unknown";
|
|
|
|
|
|
|
|
|
|
public ChannelFuture start() throws IOException, InterruptedException, URISyntaxException {
|
|
|
|
|
return connect(false);
|
|
|
|
|
}
|
|
|
|
@ -62,6 +67,7 @@ public class TunnelClient {
|
|
|
|
|
public ChannelFuture connect(boolean reconnect) throws SSLException, URISyntaxException, InterruptedException {
|
|
|
|
|
QueryStringEncoder queryEncoder = new QueryStringEncoder(this.tunnelServerUrl);
|
|
|
|
|
queryEncoder.addParam(URIConstans.METHOD, MethodConstants.AGENT_REGISTER);
|
|
|
|
|
queryEncoder.addParam(URIConstans.ARTHAS_VERSION, this.version);
|
|
|
|
|
if (id != null) {
|
|
|
|
|
queryEncoder.addParam(URIConstans.ID, id);
|
|
|
|
|
}
|
|
|
|
@ -165,4 +171,11 @@ public class TunnelClient {
|
|
|
|
|
this.id = id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getVersion() {
|
|
|
|
|
return version;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setVersion(String version) {
|
|
|
|
|
this.version = version;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|