mirror of
https://github.com/Microsoft/vscode
synced 2024-09-19 18:48:00 +00:00
Add tunnel creation options to web api
This commit is contained in:
parent
221a5570b6
commit
799e72cc2f
|
@ -3,7 +3,7 @@
|
|||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { ITunnelService, TunnelOptions, RemoteTunnel } from 'vs/platform/remote/common/tunnel';
|
||||
import { ITunnelService, TunnelOptions, RemoteTunnel, TunnelCreationOptions } from 'vs/platform/remote/common/tunnel';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
|
||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
|
@ -20,8 +20,8 @@ export class TunnelFactoryContribution extends Disposable implements IWorkbenchC
|
|||
const tunnelFactory = environmentService.options?.tunnelProvider?.tunnelFactory;
|
||||
if (tunnelFactory) {
|
||||
this._register(tunnelService.setTunnelProvider({
|
||||
forwardPort: (tunnelOptions: TunnelOptions): Promise<RemoteTunnel> | undefined => {
|
||||
const tunnelPromise = tunnelFactory(tunnelOptions);
|
||||
forwardPort: (tunnelOptions: TunnelOptions, tunnelCreationOptions: TunnelCreationOptions): Promise<RemoteTunnel> | undefined => {
|
||||
const tunnelPromise = tunnelFactory(tunnelOptions, tunnelCreationOptions);
|
||||
if (!tunnelPromise) {
|
||||
return undefined;
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ interface ITunnelProvider {
|
|||
}
|
||||
|
||||
interface ITunnelFactory {
|
||||
(tunnelOptions: ITunnelOptions, elevate?: boolean): Promise<ITunnel> | undefined;
|
||||
(tunnelOptions: ITunnelOptions, tunnelCreationOptions: TunnelCreationOptions): Promise<ITunnel> | undefined;
|
||||
}
|
||||
|
||||
interface ITunnelOptions {
|
||||
|
@ -66,6 +66,13 @@ interface ITunnelOptions {
|
|||
label?: string;
|
||||
}
|
||||
|
||||
export interface TunnelCreationOptions {
|
||||
/**
|
||||
* True when the local operating system will require elevation to use the requested local port.
|
||||
*/
|
||||
elevationRequired?: boolean;
|
||||
}
|
||||
|
||||
interface ITunnel extends IDisposable {
|
||||
remoteAddress: { port: number, host: string };
|
||||
|
||||
|
|
Loading…
Reference in a new issue