边缘网关 + Agent 的端口中继:Agent 主动连出到网关,把内网目标挂到网关端口上; 通过邀请链接按设备授权,可选审批,首次连接起计时,到期、闲置自动收回。 - portrelay-server:边缘网关(端口池、白名单与授权租约、邀请与授权网页) - portrelay-agent:Agent(yamux 隧道、本地 API 与网页面板、流量统计) - mac-native:SwiftUI 菜单栏 App
11 lines
428 B
Swift
11 lines
428 B
Swift
import AppKit
|
|
|
|
// 用法: swift mac-native/set_icon.swift [PortRelay.app](默认相对当前目录)
|
|
let appPath = CommandLine.arguments.count > 1 ? CommandLine.arguments[1] : "PortRelay.app"
|
|
let iconPath = appPath + "/Contents/Resources/AppIcon.icns"
|
|
|
|
if let img = NSImage(contentsOfFile: iconPath) {
|
|
let ok = NSWorkspace.shared.setIcon(img, forFile: appPath, options: [])
|
|
print("NSWorkspace setIcon result:", ok)
|
|
}
|