mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-02-20 07:39:15 +08:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
619fba5838 | ||
|
|
9103fd3328 | ||
|
|
b7696a2e8c | ||
|
|
5618b9ec43 | ||
|
|
9342311daa | ||
|
|
74e1bc2878 | ||
|
|
de4bb684af |
@@ -1,10 +1,10 @@
|
||||
# RustDesk | Your Remote Desktop Software
|
||||
|
||||
The best open source remote desktop software written with Rust, out of the box, no configuration required, great alternative of TeamViewer and AnyDesk. You have full control of your data, no concerns about security. You can use our rendezvous/relay server, or [set up your own](https://rustdesk.com/blog/id-relay-set/), or write your own rendezvous/relay server.
|
||||
The best open-source remote desktop software, written in Rust. Works out of the box, no configuration required. Great alternative to TeamViewer and AnyDesk! You have full control of your data, with no concerns about security. You can use our rendezvous/relay server, [set up your own](https://rustdesk.com/blog/id-relay-set/), or write your own rendezvous/relay server.
|
||||
|
||||
[**BINARY DOWNLOAD**](https://github.com/rustdesk/rustdesk/releases)
|
||||
|
||||
## Dependence
|
||||
## Dependences
|
||||
|
||||
Desktop versions use [sciter](https://sciter.com/) for GUI, please download sciter dynamic library yourself.
|
||||
|
||||
@@ -16,12 +16,12 @@ Desktop versions use [sciter](https://sciter.com/) for GUI, please download scit
|
||||
|
||||
* Prepare your Rust development env and C++ build env
|
||||
|
||||
* Install [vcpkg](https://github.com/microsoft/vcpkg), and set VCPKG_ROOT env variable correctly
|
||||
* Install [vcpkg](https://github.com/microsoft/vcpkg), and set `VCPKG_ROOT` env variable correctly
|
||||
|
||||
- Windows: vcpkg install libvpx:x64-windows-static libyuv:x64-windows-static opus:x64-windows-static
|
||||
- Linux/Osx: vcpkg install libvpx libyuv opus
|
||||
|
||||
* cargo run
|
||||
* run `cargo run`
|
||||
|
||||
## File Structure
|
||||
|
||||
|
||||
2
build.rs
2
build.rs
@@ -1,7 +1,7 @@
|
||||
#[cfg(windows)]
|
||||
fn build_windows() {
|
||||
cc::Build::new().file("src/windows.cc").compile("windows");
|
||||
// println!("cargo:rustc-link-lib=WtsApi32");
|
||||
println!("cargo:rustc-link-lib=WtsApi32");
|
||||
println!("cargo:rerun-if-changed=build.rs");
|
||||
println!("cargo:rerun-if-changed=windows.cc");
|
||||
}
|
||||
|
||||
@@ -633,6 +633,26 @@ fn get_error() -> String {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_active_username() -> String {
|
||||
let name = crate::username();
|
||||
if name != "SYSTEM" {
|
||||
return name;
|
||||
}
|
||||
extern "C" {
|
||||
fn get_active_user(path: *mut u16, n: u32) -> u32;
|
||||
}
|
||||
let buff_size = 256;
|
||||
let mut buff: Vec<u16> = Vec::with_capacity(buff_size);
|
||||
buff.resize(buff_size, 0);
|
||||
let n = unsafe { get_active_user(buff.as_mut_ptr(), buff_size as _) };
|
||||
if n == 0 {
|
||||
return "".to_owned();
|
||||
}
|
||||
let sl = unsafe { std::slice::from_raw_parts(buff.as_ptr(), n as _) };
|
||||
String::from_utf16(sl).unwrap_or("??".to_owned()).trim_end_matches('\0').to_owned()
|
||||
}
|
||||
|
||||
/*
|
||||
pub fn get_active_username() -> String {
|
||||
use std::os::windows::process::CommandExt;
|
||||
let name = crate::username();
|
||||
@@ -654,6 +674,7 @@ pub fn get_active_username() -> String {
|
||||
}
|
||||
return "".to_owned();
|
||||
}
|
||||
*/
|
||||
|
||||
pub fn is_prelogin() -> bool {
|
||||
let username = get_active_username();
|
||||
|
||||
@@ -211,7 +211,11 @@ impl RendezvousMediator {
|
||||
Config::update_latency(&host, -1);
|
||||
old_latency = 0;
|
||||
if now.duration_since(last_dns_check).map(|d| d.as_millis() as i64).unwrap_or(0) > DNS_INTERVAL {
|
||||
allow_err!(rz.dns_check());
|
||||
if let Ok(_) = rz.dns_check() {
|
||||
// in some case of network reconnect (dial IP network),
|
||||
// old UDP socket not work any more after network recover
|
||||
socket = FramedSocket::new(Config::get_any_listen_addr()).await?;
|
||||
}
|
||||
last_dns_check = now;
|
||||
}
|
||||
} else if fails > MAX_FAILS1 {
|
||||
|
||||
@@ -41,9 +41,9 @@ class Body: Reactor.Component
|
||||
<div />
|
||||
{c.is_file_transfer || c.port_forward ? "" : <div>Permissions</div>}
|
||||
{c.is_file_transfer || c.port_forward ? "" : <div .permissions>
|
||||
<div class={!c.keyboard ? "disabled" : ""} title="Allow to use keyboard and mouse"><icon .keyboard /></div>
|
||||
<div class={!c.clipboard ? "disabled" : ""} title="Allow to use clipboard"><icon .clipboard /></div>
|
||||
<div class={!c.audio ? "disabled" : ""} title="Allow to hear sound"><icon .audio /></div>
|
||||
<div class={!c.keyboard ? "disabled" : ""} title="Allow using keyboard and mouse"><icon .keyboard /></div>
|
||||
<div class={!c.clipboard ? "disabled" : ""} title="Allow using clipboard"><icon .clipboard /></div>
|
||||
<div class={!c.audio ? "disabled" : ""} title="Allow hearing sound"><icon .audio /></div>
|
||||
</div>}
|
||||
{c.port_forward ? <div>Port Forwarding: {c.port_forward}</div> : ""}
|
||||
<div style="size:*"/>
|
||||
|
||||
@@ -567,7 +567,7 @@ var create_dir_jobs = {}
|
||||
|
||||
function confirmDelete(path, is_remote) {
|
||||
handler.msgbox("custom-skip", "Confirm Delete", "<div .form> \
|
||||
<div>Are you sure you want to deelte this file?</div> \
|
||||
<div>Are you sure you want to delete this file?</div> \
|
||||
<div.ellipsis style=\"font-weight: bold;\">" + path + "</div> \
|
||||
</div>", function(res=null) {
|
||||
if (res) {
|
||||
@@ -588,7 +588,7 @@ handler.confirmDeleteFiles = function(id, i, name) {
|
||||
if (name) file_path += handler.get_path_sep(job.is_remote) + name;
|
||||
handler.msgbox("custom-skip", "Confirm Delete", "<div .form> \
|
||||
<div>Deleting #" + (i + 1) + " of " + n + " files.</div> \
|
||||
<div>Are you sure you want to deelte this file?</div> \
|
||||
<div>Are you sure you want to delete this file?</div> \
|
||||
<div.ellipsis style=\"font-weight: bold;\" .text>" + name + "</div> \
|
||||
<div><button|checkbox(remember) {ts}>Do this for all conflicts</button></div> \
|
||||
</div>", function(res=null) {
|
||||
|
||||
@@ -110,7 +110,7 @@ class Header: Reactor.Component {
|
||||
return <popup>
|
||||
<menu.context #action-options>
|
||||
<li #transfer-file>Transfer File</li>
|
||||
<li #tunnel>IP Tunneling</li>
|
||||
<li #tunnel>TCP Tunneling</li>
|
||||
{keyboard_enabled && (pi.platform == "Linux" || pi.sas_enabled) ? <li #ctrl-alt-del>Insert Ctrl + Alt + Del</li> : ""}
|
||||
{keyboard_enabled ? <li #lock-screen>Insert Lock</li> : ""}
|
||||
{false && pi.platform == "Windows" ? <li #block-input>Block user input </li> : ""}
|
||||
|
||||
@@ -249,7 +249,7 @@ class MyIdMenu: Reactor.Component {
|
||||
}
|
||||
if (value == old_value) return;
|
||||
configOptions["whitelist"] = value.replace("\n", ",");
|
||||
stdin.println("whitelist updated");
|
||||
stdout.println("whitelist updated");
|
||||
handler.set_options(configOptions);
|
||||
}, 300);
|
||||
} else if (me.id == "custom-server") {
|
||||
|
||||
@@ -363,4 +363,21 @@ extern "C"
|
||||
{
|
||||
SHAddToRecentDocs(SHARD_PATHW, path);
|
||||
}
|
||||
} // end of extern "C"
|
||||
|
||||
uint32_t get_active_user(PWSTR bufin, uint32_t nin)
|
||||
{
|
||||
uint32_t nout = 0;
|
||||
auto id = WTSGetActiveConsoleSessionId();
|
||||
PWSTR buf = NULL;
|
||||
DWORD n = 0;
|
||||
if (WTSQuerySessionInformationW(NULL, id, WTSUserName, &buf, &n))
|
||||
{
|
||||
if (buf) {
|
||||
nout = min(nin, n);
|
||||
memcpy(bufin, buf, nout);
|
||||
WTSFreeMemory(buf);
|
||||
}
|
||||
}
|
||||
return nout;
|
||||
}
|
||||
} // end of extern "C"
|
||||
|
||||
Reference in New Issue
Block a user