-
Notifications
You must be signed in to change notification settings - Fork 2.9k
大量更新内容 #693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
8odream
wants to merge
29
commits into
docmirror:master
Choose a base branch
from
8odream:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
大量更新内容 #693
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
04decbe
doc: 添加拦截器配置说明
8a72228
尝试ipv6支持
a19a738
支持ipv6查询
6d18a3b
支持IP预设使用CNAME,同时修正了来源显示错误的问题
076795d
Merge branch 'master' into master
97e106d
update
c613c33
- feat: 新增流量监控与日志开关,完善 overwall 服务器选择并修复打包问题"
3fee815
- feat(mitmproxy): 新增请求重试、按域名TLS版本与CF路由黑白名单
7a80dd1
feat(gui): 新增 GitHub 状态监控
abba345
修复测试
396c3ca
Merge branch 'master' into 0816-update
8odream d516288
fix(ci): pin pnpm to 9.13.2 for electron-builder compatibility
Copilot fac5d7a
fix(ci): restore pnpm version to match lockfile
Copilot 645912a
fix(ci): 移除 cross-spawn 覆盖以修复 Windows 打包失败
Copilot 3050ff2
Update package.json
8odream 2f0ec96
update
1ad575e
update
c6b8ad4
update
3534dc0
update
12f7705
update
a5c47ca
update
4a5610b
Merge pull request #2 from 8odream/0816-update
8odream c9a4476
update
2312d90
Merge pull request #3 from 8odream/0816-update
8odream 3cb966d
update
a10e0aa
Merge pull request #4 from 8odream/0816-update
8odream 5e18126
修复dns回传问题
d965f0d
Merge pull request #5 from 8odream/0816-update
8odream 1f70b07
Potential fix for pull request finding
cute-omega File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,144 @@ | ||
| #Requires -Version 5.1 | ||
| <# | ||
| dev-sidecar 开发环境统一启动/检查脚本 | ||
|
|
||
| 用法(在仓库根目录或任意目录执行): | ||
| pwsh -File _script\dev.ps1 -Action start # 启动开发环境并等待端口就绪 | ||
| pwsh -File _script\dev.ps1 -Action check # 检查端口监听状态 | ||
| pwsh -File _script\dev.ps1 -Action stop # 停止开发环境(按端口结束进程) | ||
| pwsh -File _script\dev.ps1 -Action restart # 停止后重新启动 | ||
|
|
||
| 可选参数: | ||
| -Port 8081 # 前端 dev server 端口,默认 8081 | ||
| -Foreground # start 时在前台运行,日志直接输出到当前终端(Ctrl+C 停止) | ||
| -SkipKill # start/restart 时不先结束已占用端口的进程 | ||
| #> | ||
| param( | ||
| [ValidateSet('start', 'check', 'stop', 'restart')] | ||
| [string]$Action = 'start', | ||
|
|
||
| [int]$Port = 8081, | ||
|
|
||
| [switch]$Foreground, | ||
|
|
||
| [switch]$SkipKill | ||
| ) | ||
|
|
||
| $ErrorActionPreference = 'SilentlyContinue' | ||
|
|
||
| $repoRoot = Split-Path -Parent $PSScriptRoot | ||
| $guiDir = Join-Path $repoRoot 'packages\gui' | ||
| $electronDev = Join-Path $PSScriptRoot 'electron-dev.mjs' | ||
| $proxyHttpPort = 31180 | ||
| $proxyHttpsPort = 31181 | ||
| $ports = @($Port, $proxyHttpPort, $proxyHttpsPort) | ||
|
|
||
| function Get-Listeners([int[]]$TargetPorts) { | ||
| Get-NetTCPConnection -State Listen -ErrorAction SilentlyContinue | | ||
| Where-Object { $TargetPorts -contains $_.LocalPort } | ||
| } | ||
|
|
||
| function Show-Status([string]$Title) { | ||
| Write-Host "== $Title ==" | ||
| $listeners = @(Get-Listeners $ports) | ||
| if ($listeners.Count -gt 0) { | ||
| $listeners | Sort-Object LocalPort | ForEach-Object { | ||
| $procName = (Get-Process -Id $_.OwningProcess -ErrorAction SilentlyContinue).ProcessName | ||
| Write-Host (" {0}:{1,-6} PID {2,-7} {3}" -f $_.LocalAddress, $_.LocalPort, $_.OwningProcess, $procName) | ||
| } | ||
| } else { | ||
| Write-Host ' no listeners' | ||
| } | ||
| Write-Host '' | ||
| } | ||
|
|
||
| function Stop-DevSidecar([int[]]$TargetPorts) { | ||
| Write-Host '== stopping dev-sidecar ==' | ||
| $listeners = @(Get-Listeners $TargetPorts) | ||
| $procIds = @($listeners | Select-Object -ExpandProperty OwningProcess -Unique) | ||
| if ($procIds.Count -eq 0) { | ||
| Write-Host ' no listeners' | ||
| } else { | ||
| foreach ($procId in $procIds) { | ||
| Stop-Process -Id $procId -Force -ErrorAction SilentlyContinue | ||
| Write-Host " killed PID $procId" | ||
| } | ||
| } | ||
| Start-Sleep -Milliseconds 600 | ||
| Write-Host '' | ||
| } | ||
|
|
||
| function Wait-Ports([int[]]$TargetPorts, [int]$TimeoutSec = 120) { | ||
| $deadline = (Get-Date).AddSeconds($TimeoutSec) | ||
| $ready = @{} | ||
|
|
||
| while ((Get-Date) -lt $deadline) { | ||
| $listeners = @(Get-Listeners $TargetPorts) | ||
| foreach ($p in $TargetPorts) { | ||
| if ($listeners.LocalPort -contains $p) { | ||
| $ready[$p] = $true | ||
| } | ||
| } | ||
|
|
||
| if ($ready.Count -ge $TargetPorts.Count) { | ||
| break | ||
| } | ||
|
|
||
| Start-Sleep -Seconds 1 | ||
| } | ||
|
|
||
| if ($ready.Count -lt $TargetPorts.Count) { | ||
| $missing = @($TargetPorts | Where-Object { -not $ready.ContainsKey($_) }) | ||
| Write-Host "等待端口超时,未就绪端口: $($missing -join ', ')" | ||
| } else { | ||
| Write-Host "端口已全部就绪: $($TargetPorts -join ', ')" | ||
| } | ||
| } | ||
|
|
||
| function Start-DevSidecar([int]$DevPort) { | ||
| $node = (Get-Command node -ErrorAction Stop).Source | ||
|
|
||
| if ($Foreground) { | ||
| Write-Host "== starting dev-sidecar in foreground (Ctrl+C to stop) ==" | ||
| Push-Location $guiDir | ||
| try { | ||
| & $node $electronDev '--port' "$DevPort" | ||
| } finally { | ||
| Pop-Location | ||
| } | ||
| return | ||
| } | ||
|
|
||
| Write-Host "== starting dev-sidecar ==" | ||
| $proc = Start-Process -FilePath $node -ArgumentList @($electronDev, '--port', "$DevPort") -WorkingDirectory $guiDir -WindowStyle Hidden -PassThru | ||
| Write-Host " launcher PID: $($proc.Id)" | ||
| Wait-Ports $ports | ||
| Show-Status 'port status after start' | ||
| } | ||
|
|
||
| switch ($Action) { | ||
| 'check' { | ||
| Show-Status "port status (dev: $Port, http proxy: $proxyHttpPort, https proxy: $proxyHttpsPort)" | ||
| break | ||
| } | ||
|
|
||
| 'stop' { | ||
| Stop-DevSidecar $ports | ||
| Show-Status 'port status after stop' | ||
| break | ||
| } | ||
|
|
||
| 'start' { | ||
| if (-not $SkipKill) { | ||
| Stop-DevSidecar $ports | ||
| } | ||
| Start-DevSidecar $Port | ||
| break | ||
| } | ||
|
|
||
| 'restart' { | ||
| Stop-DevSidecar $ports | ||
| Start-DevSidecar $Port | ||
| break | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://aistudio.xiaomimimo.com/#/share/e3ebd10743ae2728cfdca9e74d1eed8d 改成js并加上注释