mirror of
https://github.com/dart-lang/sdk
synced 2024-09-21 03:13:14 +00:00
368b3f0ab4
Changes from original CL:
* Removed service_undocumented.md
* Removed generation of wrappers for undocumented RPCs
* Cleaned up generation code which was used for generating wrappers for undocumented RPCs
* Removed JARs from pkg/vm_service/java/third_party
This reverts commit 477a3c4748
.
Change-Id: I8d36733c8b2602e4935c3f23698d3f7c97a20187
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110135
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
23 lines
896 B
Dart
23 lines
896 B
Dart
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
import 'package:meta/meta.dart';
|
|
|
|
/// Map the URI to a WebSocket URI for the VM service protocol.
|
|
///
|
|
/// If the URI is already a VM Service WebSocket URI it will not be modified.
|
|
Uri convertToWebSocketUrl({@required Uri serviceProtocolUrl}) {
|
|
final isSecure = serviceProtocolUrl.isScheme('wss') ||
|
|
serviceProtocolUrl.isScheme('https');
|
|
final scheme = isSecure ? 'wss' : 'ws';
|
|
|
|
final path = serviceProtocolUrl.path.endsWith('/ws')
|
|
? serviceProtocolUrl.path
|
|
: (serviceProtocolUrl.path.endsWith('/')
|
|
? '${serviceProtocolUrl.path}ws'
|
|
: '${serviceProtocolUrl.path}/ws');
|
|
|
|
return serviceProtocolUrl.replace(scheme: scheme, path: path);
|
|
}
|