| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 private static final int DEFAULT_PORT = 8888; | 35 private static final int DEFAULT_PORT = 8888; |
| 36 | 36 |
| 37 // Regex pattern used for checking if room id looks like an IP. | 37 // Regex pattern used for checking if room id looks like an IP. |
| 38 static final Pattern IP_PATTERN = Pattern.compile( | 38 static final Pattern IP_PATTERN = Pattern.compile( |
| 39 "(" | 39 "(" |
| 40 // IPv4 | 40 // IPv4 |
| 41 + "((\\d+\\.){3}\\d+)|" | 41 + "((\\d+\\.){3}\\d+)|" |
| 42 // IPv6 | 42 // IPv6 |
| 43 + "\\[((([0-9a-fA-F]{1,4}:)*[0-9a-fA-F]{1,4})?::" | 43 + "\\[((([0-9a-fA-F]{1,4}:)*[0-9a-fA-F]{1,4})?::" |
| 44 + "(([0-9a-fA-F]{1,4}:)*[0-9a-fA-F]{1,4})?)\\]|" | 44 + "(([0-9a-fA-F]{1,4}:)*[0-9a-fA-F]{1,4})?)\\]|" |
| 45 + "\\[(([0-9a-fA-F]{1,4}:)*[0-9a-fA-F]{1,4})\\]|" | 45 + "\\[(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4})\\]|" |
| 46 // IPv6 without [] | 46 // IPv6 without [] |
| 47 + "((([0-9a-fA-F]{1,4}:)*[0-9a-fA-F]{1,4})?::(([0-9a-fA-F]{1,4}:)*[0-9a-
fA-F]{1,4})?)|" | 47 + "((([0-9a-fA-F]{1,4}:)*[0-9a-fA-F]{1,4})?::(([0-9a-fA-F]{1,4}:)*[0-9a-
fA-F]{1,4})?)|" |
| 48 + "(([0-9a-fA-F]{1,4}:)*[0-9a-fA-F]{1,4})|" | 48 + "(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4})|" |
| 49 // Literals | 49 // Literals |
| 50 + "localhost" | 50 + "localhost" |
| 51 + ")" | 51 + ")" |
| 52 // Optional port number | 52 // Optional port number |
| 53 + "(:(\\d+))?" | 53 + "(:(\\d+))?" |
| 54 ); | 54 ); |
| 55 | 55 |
| 56 private final ExecutorService executor; | 56 private final ExecutorService executor; |
| 57 private final SignalingEvents events; | 57 private final SignalingEvents events; |
| 58 private TCPChannelClient tcpClient; | 58 private TCPChannelClient tcpClient; |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 return json; | 345 return json; |
| 346 } | 346 } |
| 347 | 347 |
| 348 // Converts a JSON candidate to a Java object. | 348 // Converts a JSON candidate to a Java object. |
| 349 private static IceCandidate toJavaCandidate(JSONObject json) throws JSONExcept
ion { | 349 private static IceCandidate toJavaCandidate(JSONObject json) throws JSONExcept
ion { |
| 350 return new IceCandidate(json.getString("id"), | 350 return new IceCandidate(json.getString("id"), |
| 351 json.getInt("label"), | 351 json.getInt("label"), |
| 352 json.getString("candidate")); | 352 json.getString("candidate")); |
| 353 } | 353 } |
| 354 } | 354 } |
| OLD | NEW |