More fixes for proxies

This commit is contained in:
Christopher Schnick
2022-11-26 16:44:09 +01:00
parent 097d23f306
commit 696dc036ac
8 changed files with 39 additions and 16 deletions
@@ -11,7 +11,7 @@ import com.fasterxml.jackson.databind.node.TextNode;
import io.xpipe.beacon.exchange.MessageExchanges;
import io.xpipe.beacon.exchange.data.ClientErrorMessage;
import io.xpipe.beacon.exchange.data.ServerErrorMessage;
import io.xpipe.core.process.ProcessControl;
import io.xpipe.core.process.CommandProcessControl;
import io.xpipe.core.util.JacksonMapper;
import lombok.Builder;
import lombok.EqualsAndHashCode;
@@ -104,7 +104,7 @@ public class BeaconClient implements AutoCloseable {
return client;
}
public static BeaconClient connectGateway(ProcessControl control, GatewayClientInformation information) throws Exception {
public static BeaconClient connectGateway(CommandProcessControl control, GatewayClientInformation information) throws Exception {
var client = new BeaconClient(() -> {}, control.getStdout(), control.getStdin());
client.sendObject(JacksonMapper.newMapper().valueToTree(information));
return client;
@@ -1,5 +1,6 @@
package io.xpipe.beacon.exchange;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import io.xpipe.beacon.RequestMessage;
import io.xpipe.beacon.ResponseMessage;
import lombok.Builder;
@@ -7,8 +8,6 @@ import lombok.NonNull;
import lombok.Value;
import lombok.extern.jackson.Jacksonized;
import java.util.List;
public class NamedFunctionExchange implements MessageExchange {
@Override
@@ -23,7 +22,8 @@ public class NamedFunctionExchange implements MessageExchange {
@NonNull
String id;
@NonNull List<Object> arguments;
@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, property="type")
@NonNull Object[] arguments;
}
@Jacksonized