From 58c4d565f604d6221bd97ef18306e9a3f315925c Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Tue, 10 Aug 2021 18:04:44 +0200 Subject: [PATCH] Server SDKs: Connection ip property --- .../java/io/openvidu/java/client/Connection.java | 12 ++++++++++++ openvidu-node-client/src/Connection.ts | 7 +++++++ 2 files changed, 19 insertions(+) diff --git a/openvidu-java-client/src/main/java/io/openvidu/java/client/Connection.java b/openvidu-java-client/src/main/java/io/openvidu/java/client/Connection.java index bef16873..2e3a01e0 100644 --- a/openvidu-java-client/src/main/java/io/openvidu/java/client/Connection.java +++ b/openvidu-java-client/src/main/java/io/openvidu/java/client/Connection.java @@ -37,6 +37,7 @@ public class Connection { private Long createdAt; private Long activeAt; private String location; + private String ip; private String platform; private String clientData; private ConnectionProperties connectionProperties; @@ -215,6 +216,13 @@ public class Connection { return location; } + /** + * Returns the IP of the connection, as seen by OpenVidu Server + */ + public String getIp() { + return ip; + } + /** * Returns a complete description of the platform used by the participant to * connect to the session @@ -262,6 +270,7 @@ public class Connection { json.addProperty("createdAt", this.createdAt()); json.addProperty("activeAt", this.activeAt()); json.addProperty("location", this.getLocation()); + json.addProperty("ip", this.getIp()); json.addProperty("platform", this.getPlatform()); json.addProperty("clientData", this.getClientData()); json.addProperty("token", this.getToken()); @@ -383,6 +392,9 @@ public class Connection { if (!json.get("location").isJsonNull()) { this.location = json.get("location").getAsString(); } + if (!json.get("ip").isJsonNull()) { + this.ip = json.get("ip").getAsString(); + } if (!json.get("platform").isJsonNull()) { this.platform = json.get("platform").getAsString(); } diff --git a/openvidu-node-client/src/Connection.ts b/openvidu-node-client/src/Connection.ts index 88e4263d..530fc93f 100644 --- a/openvidu-node-client/src/Connection.ts +++ b/openvidu-node-client/src/Connection.ts @@ -59,6 +59,11 @@ export class Connection { */ location: string; + /** + * IP of the Connection, as seen by OpenVidu Server + */ + ip: string; + /** * A complete description of the platform used by the participant to connect to the session */ @@ -119,6 +124,7 @@ export class Connection { this.createdAt = json.createdAt; this.activeAt = json.activeAt; this.location = json.location; + this.ip = json.ip; this.platform = json.platform; this.clientData = json.clientData; this.token = json.token; @@ -220,6 +226,7 @@ export class Connection { this.connectionProperties.networkCache === other.connectionProperties.networkCache && this.token === other.token && this.location === other.location && + this.ip === other.ip && this.platform === other.platform && this.clientData === other.clientData && this.subscribers.length === other.subscribers.length &&