From 36a210aae9f7ae51a12993d9c8135db0187cdbb5 Mon Sep 17 00:00:00 2001 From: Isaiah Becker-Mayer Date: Thu, 11 May 2023 09:00:04 -0700 Subject: [PATCH] fix(web-client): paths to web crate and unsupported call (#128) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: BenoƮt CORTIER --- crates/ironrdp-client/Cargo.toml | 1 + crates/ironrdp-web/src/session.rs | 9 ++++----- web-client/iron-remote-gui/package-lock.json | 4 ++-- web-client/iron-remote-gui/pre-build.js | 2 +- .../iron-remote-gui/src/interfaces/UserInteraction.ts | 2 +- web-client/iron-remote-gui/src/services/PublicAPI.ts | 4 ++-- .../src/services/wasm-bridge.service.ts | 10 +++++----- web-client/iron-svelte-client/package.json | 5 +++-- 8 files changed, 19 insertions(+), 18 deletions(-) diff --git a/crates/ironrdp-client/Cargo.toml b/crates/ironrdp-client/Cargo.toml index fe8cd8b7..592fb90c 100644 --- a/crates/ironrdp-client/Cargo.toml +++ b/crates/ironrdp-client/Cargo.toml @@ -10,6 +10,7 @@ repository.workspace = true authors.workspace = true keywords.workspace = true categories.workspace = true +default-run = "ironrdp-client" [features] default = ["rustls"] diff --git a/crates/ironrdp-web/src/session.rs b/crates/ironrdp-web/src/session.rs index 7466f15c..47c716c6 100644 --- a/crates/ironrdp-web/src/session.rs +++ b/crates/ironrdp-web/src/session.rs @@ -350,11 +350,10 @@ fn build_config( .unwrap_or(0) .pipe(u32::try_from) .unwrap(), - client_name: "IronRDP Web".to_owned(), // FIXME: in native clients, this is the client machine hostname - client_dir: std::env::current_dir() - .expect("current directory") - .to_string_lossy() - .into_owned(), + client_name: "IronRDP Web".to_owned(), // FIXME: in native clients, this is the client machine hostname. Should we use the browser user agent here? + // NOTE: hardcode this value like in freerdp + // https://github.com/FreeRDP/FreeRDP/blob/4e24b966c86fdf494a782f0dfcfc43a057a2ea60/libfreerdp/core/settings.c#LL49C34-L49C70 + client_dir: "C:\\Windows\\System32\\mstscax.dll".to_owned(), platform: ironrdp::pdu::rdp::capability_sets::MajorPlatformType::Unspecified, } } diff --git a/web-client/iron-remote-gui/package-lock.json b/web-client/iron-remote-gui/package-lock.json index 79ff8477..b48c6a0e 100644 --- a/web-client/iron-remote-gui/package-lock.json +++ b/web-client/iron-remote-gui/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devolutions/iron-remote-gui", - "version": "0.5.0", + "version": "0.6.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@devolutions/iron-remote-gui", - "version": "0.5.0", + "version": "0.6.0", "dependencies": { "@types/ua-parser-js": "^0.7.36", "ua-parser-js": "^1.0.33" diff --git a/web-client/iron-remote-gui/pre-build.js b/web-client/iron-remote-gui/pre-build.js index 65f0eba6..e99dce55 100644 --- a/web-client/iron-remote-gui/pre-build.js +++ b/web-client/iron-remote-gui/pre-build.js @@ -19,4 +19,4 @@ let run = async function (command, cwd) { }) } -await run('wasm-pack build --target web', '../../crates/web'); +await run('wasm-pack build --target web', '../../crates/ironrdp-web'); diff --git a/web-client/iron-remote-gui/src/interfaces/UserInteraction.ts b/web-client/iron-remote-gui/src/interfaces/UserInteraction.ts index 3629491c..22f30482 100644 --- a/web-client/iron-remote-gui/src/interfaces/UserInteraction.ts +++ b/web-client/iron-remote-gui/src/interfaces/UserInteraction.ts @@ -7,7 +7,7 @@ export interface UserInteraction { setScale(scale: ScreenScale); - connect(username: string, password: string, hostname: string, gatewayAddress: string, domain: string, authToken: string): Observable; + connect(username: string, password: string, destination: string, proxyAddress: string, serverDomain: string, authToken: string): Observable; ctrlAltDel(); diff --git a/web-client/iron-remote-gui/src/services/PublicAPI.ts b/web-client/iron-remote-gui/src/services/PublicAPI.ts index 8bc1568f..02f6b6a3 100644 --- a/web-client/iron-remote-gui/src/services/PublicAPI.ts +++ b/web-client/iron-remote-gui/src/services/PublicAPI.ts @@ -13,9 +13,9 @@ export class PublicAPI { this.wasmService = wasmService; } - private connect(username: string, password: string, hostname: string, gatewayAddress: string, domain: string, authToken: string): Observable { + private connect(username: string, password: string, destination: string, proxyAddress: string, serverDomain: string, authToken: string): Observable { loggingService.info('Initializing connection.'); - return this.wasmService.connect(username, password, hostname, gatewayAddress, domain, authToken); + return this.wasmService.connect(username, password, destination, proxyAddress, serverDomain, authToken); } private ctrlAltDel() { diff --git a/web-client/iron-remote-gui/src/services/wasm-bridge.service.ts b/web-client/iron-remote-gui/src/services/wasm-bridge.service.ts index 582aa078..f0acdf4e 100644 --- a/web-client/iron-remote-gui/src/services/wasm-bridge.service.ts +++ b/web-client/iron-remote-gui/src/services/wasm-bridge.service.ts @@ -1,5 +1,5 @@ import {BehaviorSubject, from, Observable, of, Subject} from 'rxjs'; -import init, {DeviceEvent, InputTransaction, ironrdp_init, IronRdpError, Session, SessionBuilder} from '../../../../crates/web/pkg/ironrdp_web'; +import init, {DeviceEvent, InputTransaction, ironrdp_init, IronRdpError, Session, SessionBuilder} from '../../../../crates/ironrdp-web/pkg/ironrdp_web'; import {loggingService} from './logging.service'; import {catchError, filter, map} from 'rxjs/operators'; import {scanCode} from '../lib/scancodes'; @@ -82,11 +82,11 @@ export class WasmBridgeService { } - connect(username: string, password: string, hostname: string, gatewayAddress: string, domain: string, authToken: string): Observable { + connect(username: string, password: string, destination: string, proxyAddress: string, serverDomain: string, authToken: string): Observable { const sessionBuilder = SessionBuilder.new(); - sessionBuilder.gateway_address(gatewayAddress); - sessionBuilder.hostname(hostname); - sessionBuilder.domain(domain); + sessionBuilder.proxy_address(proxyAddress); + sessionBuilder.destination(destination); + sessionBuilder.server_domain(serverDomain); sessionBuilder.password(password); sessionBuilder.auth_token(authToken); sessionBuilder.username(username); diff --git a/web-client/iron-svelte-client/package.json b/web-client/iron-svelte-client/package.json index bbc09b5e..5de8f156 100644 --- a/web-client/iron-svelte-client/package.json +++ b/web-client/iron-svelte-client/package.json @@ -6,9 +6,10 @@ "pre-build": "node ./pre-build.js", "pre-build-no-wasm": "node ./pre-build.js no-wasm", "dev": "vite dev", - "dev-all": "npm run pre-build && vite dev", - "dev-no-wasm": "npm run pre-build-no-wasm && vite dev", + "dev-all": "npm run pre-build && vite dev --host", + "dev-no-wasm": "npm run pre-build-no-wasm && vite dev --host", "build": "npm run pre-build && vite build", + "build-no-wasm": "npm run pre-build-no-wasm && vite build", "preview": "vite preview", "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",