[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"auth:me":3,"site-config":5,"blog-post-en-port-forwarding":95},{"user":4,"membership":4},null,{"settings":6,"products":22,"navigation":37,"oauth":88,"endpoints":90},{"site.name":7,"site.tagline":8,"site.description":9,"site.tagline.en":10,"site.description.en":11,"site.keywords":12,"site.icp":13,"site.police":14,"site.contact_email":15,"site.company":16,"site.copyright":16,"site.social.github":17,"site.social.x":16,"site.social.wechat":16,"site.support_url":16,"site.announcement":16,"trial.enabled":18,"trial.days":19,"trial.grant_on":20,"trial.enabled_at":16,"site.url":21},"DSH Remote","管理远端 DSH 的客户端：装、连、转、用一个窗口。","DSH Remote 是 DeepSeek Harness 的远程客户端：装好、连上、转发、打开，四件事一个窗口。","The remote client for DeepSeek Harness: install, connect, forward, work.","DSH Remote is the remote client for DeepSeek Harness: four jobs, one window.","DeepSeek Harness,DSH,DSH Remote,远程客户端,SSH 多环境,端口转发,DSH 生命周期,dsh-devtools,VSCode Remote,远程开发,AI 编程","赣ICP备2026027330号-1","赣公网安备36112402000139号","support@dshremote.cn","","https:\u002F\u002Fgithub.com\u002Fzhanglaian\u002Fdsh-remote",true,7,"register","https:\u002F\u002Fdshremote.cn",[23,31],{"slug":24,"name":25,"kind":26,"summary":27,"icon":28,"latestVersion":29,"minSupportedVersion":30},"dsh-remote","DSH Remote 桌面端","desktop","Windows \u002F macOS \u002F Linux 桌面客户端","i-lucide-monitor","1.2.0","0.8.0",{"slug":32,"name":33,"kind":34,"summary":35,"icon":36,"latestVersion":4,"minSupportedVersion":4},"dsh-mobile","DSH Remote 手机端","mobile","Android \u002F iOS 手机客户端","i-lucide-smartphone",{"main":38,"footer":63},[39,43,47,51,55,59],{"key":40,"to":41,"icon":42},"nav.download","\u002Fdownload","i-lucide-download",{"key":44,"to":45,"icon":46},"nav.pricing","\u002Fpricing","i-lucide-tag",{"key":48,"to":49,"icon":50},"nav.docs","\u002Fdocs","i-lucide-book-open",{"key":52,"to":53,"icon":54},"nav.blog","\u002Fblog","i-lucide-newspaper",{"key":56,"to":57,"icon":58},"nav.changelog","\u002Fchangelog","i-lucide-list",{"key":60,"to":61,"icon":62},"nav.about","\u002Fabout","i-lucide-info",[64,70,79],{"titleKey":65,"items":66},"footer.product",[67,68,69],{"key":40,"to":41},{"key":44,"to":45},{"key":56,"to":57},{"titleKey":71,"items":72},"footer.resources",[73,74,75,76],{"key":48,"to":49},{"key":52,"to":53},{"key":60,"to":61},{"key":77,"to":78},"nav.contact","\u002Fcontact",{"titleKey":80,"items":81},"footer.legal",[82,85],{"key":83,"to":84},"nav.privacy","\u002Flegal\u002Fprivacy",{"key":86,"to":87},"nav.terms","\u002Flegal\u002Fterms",{"providers":89},[],{"policy":91,"desktopLatest":92,"appLatest":93,"announcements":94},"\u002Fapi\u002Fv1\u002Fclient\u002Fpolicy","\u002Fapi\u002Fv1\u002Fdesktop\u002Flatest","\u002Fapi\u002Fv1\u002Fapp\u002Flatest","\u002Fapi\u002Fv1\u002Fannouncements",{"post":96,"locale":143,"requestedLocale":143,"fallback":142,"related":144},{"slug":97,"title":98,"excerpt":99,"html":100,"toc":101,"cover":4,"category":136,"tags":4,"publishedAt":137,"updatedAt":138,"seoTitle":139,"seoDescription":140,"ogImage":4,"canonical":4,"keywords":141,"noindex":142},"port-forwarding","Port forwarding: open remote services the VSCode Remote way","Your service binds 127.0.0.1, so your laptop cannot reach it. DSH Remote maps ports owned by DSH and actually listening, and keeps the same port number.","\u003Cblockquote>\n\u003Cp>\u003Cstrong>In one sentence:\u003C\u002Fstrong> DSH Remote maps every port that belongs to a process DSH started \u003Cem>and\u003C\u002Fem> is actually listening right now to \u003Ccode>127.0.0.1\u003C\u002Fcode> on your machine, so \u003Ccode>localhost:3000\u003C\u002Fcode> is the 3000 on your dev box — no port numbers to remember, no \u003Ccode>ssh -L\u003C\u002Fcode> to type.\u003C\u002Fp>\n\u003C\u002Fblockquote>\n\u003Ch2 id=\"the-problem-it-removes\">The problem it removes\u003C\u002Fh2>\n\u003Cp>Services on a dev machine usually bind \u003Ccode>127.0.0.1\u003C\u002Fcode> — reachable only from the machine itself. That default is correct, and it is why your laptop cannot open the page.\u003C\u002Fp>\n\u003Cp>The old answer was a hand-written SSH tunnel: \u003Ccode>ssh -L 3000:127.0.0.1:3000 user@host\u003C\u002Fcode>. It works until it doesn't: you retype ports per environment, a dropped connection kills the tunnel, and HTTPS, 401 auth and \u003Ccode>Host\u003C\u002Fcode> headers all become your problem.\u003C\u002Fp>\n\u003Cp>Port forwarding turns it into rules you can see, and mostly never type.\u003C\u002Fp>\n\u003Ch2 id=\"three-steps\">Three steps\u003C\u002Fh2>\n\u003Col>\n\u003Cli>\n\u003Cp>\u003Cstrong>Install the companion plugin inside the remote DSH.\u003C\u002Fstrong> Only automatic forwarding needs it:\u003C\u002Fp>\n\u003Cpre class=\"shiki shiki-themes github-light github-dark\" style=\"background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"color:#6F42C1;--shiki-dark:#B392F0\">dsh\u003C\u002Fspan>\u003Cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> plugin\u003C\u002Fspan>\u003Cspan style=\"color:#005CC5;--shiki-dark:#79B8FF\"> --profile\u003C\u002Fspan>\u003Cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> web\u003C\u002Fspan>\u003Cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> add\u003C\u002Fspan>\u003Cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\"> @zhangzhian\u002Fdsh-devtools\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>Restart dsh afterwards. The plugin writes the &quot;which process owns which listening port&quot; snapshot.\u003C\u002Fp>\n\u003C\u002Fli>\n\u003Cli>\n\u003Cp>\u003Cstrong>Start a service inside DSH.\u003C\u002Fstrong> Click ▶ in the runs panel, or just type \u003Ccode>pnpm run dev\u003C\u002Fcode> in a DSH terminal.\u003C\u002Fp>\n\u003C\u002Fli>\n\u003Cli>\n\u003Cp>\u003Cstrong>Open the page.\u003C\u002Fstrong> A rule appears under \u003Cstrong>Settings → Port forwarding\u003C\u002Fstrong>; click \u003Cstrong>Open page\u003C\u002Fstrong>. Or do nothing and let it appear.\u003C\u002Fp>\n\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cp>Manual rules do not need the plugin. Automatic forwarding creates the rule only; tabs are opt-in via a switch that is off by default.\u003C\u002Fp>\n\u003Ch2 id=\"the-rule-ownership-liveness\">The rule: ownership × liveness\u003C\u002Fh2>\n\u003Cp>Automatic forwarding is not &quot;the remote has a new port, forward it&quot;. That would drag in someone else's database. Two conditions must hold at once:\u003C\u002Fp>\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Snapshot only\u003C\u002Fth>\n\u003Cth>Listening ports only\u003C\u002Fth>\n\u003Cth>Ownership × liveness (what DSH Remote does)\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>A few hundred milliseconds after a service stops, the snapshot is stale\u003C\u002Ftd>\n\u003Ctd>Every \u003Cem>other\u003C\u002Fem> service on the box gets forwarded too\u003C\u002Ftd>\n\u003Ctd>Ours, and listening right now\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>In practice:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Cstrong>Ownership comes from process lineage.\u003C\u002Fstrong> Only descendants of the DSH host process count as ours. The plugin runs \u003Ccode>ps\u003C\u002Fcode> once a second, reads the listening table with \u003Ccode>lsof\u003C\u002Fcode>, intersects the two, and writes the result to \u003Ccode>~\u002F.dsh\u002Fstorages\u002Fdevtools_ports.json\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Liveness is checked by the client.\u003C\u002Fstrong> Every 4 seconds it reads that snapshot and confirms the port really is listening remotely.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Terminal-started services count too.\u003C\u002Fstrong> On the chain \u003Ccode>dsh → zsh -i → pnpm → nuxt\u003C\u002Fcode>, the process that listens is still a DSH descendant.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Nothing has to be &quot;new&quot;.\u003C\u002Fstrong> The snapshot describes what is alive now, so services running before you connected are picked up.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>If the plugin is missing or the snapshot cannot be read, \u003Cstrong>no automatic rule is created\u003C\u002Fstrong> — without ownership information the client will not decide for you. Rules that already exist are still checked against &quot;is it listening on the remote side?&quot;.\u003C\u002Fp>\n\u003Cp>The status line separates three cases: nothing there (\u003Ccode>owned: []\u003C\u002Fcode>), this round could not probe (\u003Ccode>owned: null\u003C\u002Fcode> — treated as blind, so no rule is touched), or the file cannot be read. None of them means &quot;zero ports reported&quot;.\u003C\u002Fp>\n\u003Ch2 id=\"same-port-first\">Same port first\u003C\u002Fh2>\n\u003Cp>If the service listens on 3000 remotely, the local entry tries 3000 as well. \u003Ccode>localhost:3000\u003C\u002Fcode> in your address bar and bookmarks keeps working, OAuth allow-lists stay valid, and the page origin is unchanged, so the remote DSH login state survives.\u003C\u002Fp>\n\u003Cp>When the local side cannot take the same number, the rule is still built:\u003C\u002Fp>\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Remote port\u003C\u002Fth>\n\u003Cth>Windows\u003C\u002Fth>\n\u003Cth>Linux\u003C\u002Fth>\n\u003Cth>macOS\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n\u003Ctd>82\u003C\u002Ftd>\n\u003Ctd>Same number (82:82)\u003C\u002Ftd>\n\u003Ctd>Try 82:82, fall back to a high port\u003C\u002Ftd>\n\u003Ctd>Skip, use a high port\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>80 \u002F 443\u003C\u002Ftd>\n\u003Ctd>Same as above\u003C\u002Ftd>\n\u003Ctd>Same as above\u003C\u002Ftd>\n\u003Ctd>Same as above\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>3000\u003C\u002Ftd>\n\u003Ctd>3000:3000\u003C\u002Ftd>\n\u003Ctd>3000:3000\u003C\u002Ftd>\n\u003Ctd>3000:3000\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>Low remote ports are not excluded: the forwarded connection starts from the remote loopback, so only the local listener is affected.\u003C\u002Fp>\n\u003Cp>Never forwarded automatically: SSH itself (22 \u002F 2222), the DSH Web port (3080), and addresses bound to a specific interface (\u003Ccode>192.168.1.5:8081\u003C\u002Fcode>) — not reachable from the remote loopback.\u003C\u002Fp>\n\u003Ch2 id=\"manual-rules-static-rules-and-cleanup\">Manual rules, static rules, and cleanup\u003C\u002Fh2>\n\u003Cp>Under \u003Cstrong>Settings → Forwarding rules\u003C\u002Fstrong> you can write a rule by hand.\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Ccode>localhost\u003C\u002Fcode> on the remote side is fine.\u003C\u002Fli>\n\u003Cli>Set the local port to \u003Ccode>0\u003C\u002Fcode> and the system picks a free one.\u003C\u002Fli>\n\u003Cli>Tick \u003Cstrong>Static\u003C\u002Fstrong> and the rule is never cleaned up automatically.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>Cleanup behaves like this:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>When the remote port stops listening, the rule and its tab are removed — \u003Cstrong>manual rules are checked too\u003C\u002Fstrong>.\u003C\u002Fli>\n\u003Cli>It takes 3 rounds (about 6 seconds), so a brief restart does not count. Rules you created or edited get a 5-minute grace period, and a service that really comes back recovers in the same round after a removal.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>Static rules and the built-in DSH entry are never removed.\u003C\u002Fp>\n\u003Ch2 id=\"hmr-and-the-host-header\">HMR and the Host header\u003C\u002Fh2>\n\u003Cp>HTTP and WebSocket are just byte streams through a transparent TCP forward. The page loads from \u003Ccode>http:\u002F\u002F127.0.0.1:&lt;local-port&gt;\u003C\u002Fcode>, so the HMR client reconnects to the same port and hot reload works.\u003C\u002Fp>\n\u003Cp>The one thing that needs handling is the \u003Ccode>Host\u003C\u002Fcode> header: your browser sends \u003Ccode>Host: 127.0.0.1:&lt;local-port&gt;\u003C\u002Fcode>, and a remote Vite dev server with an \u003Ccode>allowedHosts\u003C\u002Fcode> allow-list rejects it. Each rule can rewrite \u003Ccode>Host\u003C\u002Fcode> (\u003Ccode>origin\u003C\u002Fcode> \u002F \u003Ccode>target\u003C\u002Fcode> \u002F \u003Ccode>off\u003C\u002Fcode> \u002F custom), and \u003Ccode>Origin\u003C\u002Fcode> too.\u003C\u002Fp>\n\u003Cp>https targets are the exception: \u003Ccode>Host\u003C\u002Fcode> lives inside TLS and cannot be rewritten. The TLS stream is passed through and opened as \u003Ccode>https:\u002F\u002F127.0.0.1:&lt;port&gt;\u003C\u002Fcode> locally; certificate mismatches are tolerated only for loopback, since the traffic is already inside the tunnel. The remote side answers with its default vhost — fine when there is only one.\u003C\u002Fp>\n\u003Ch2 id=\"pages-that-ask-for-a-password\">Pages that ask for a password\u003C\u002Fh2>\n\u003Cp>When the address needs authentication (Basic auth on a reverse proxy, a login wall in front of DSH), the app raises its own dialog instead of a bare \u003Ccode>401\u003C\u002Fcode>: it names the address and realm, and \u003Cstrong>Remember password\u003C\u002Fstrong> stores the credential encrypted in the system key store.\u003C\u002Fp>\n\u003Ch2 id=\"one-window-several-tabs\">One window, several tabs\u003C\u002Fh2>\n\u003Cp>The DSH home page is the base page: it cannot be closed and its address cannot be edited. Forwarded pages open as tabs with back \u002F forward \u002F reload and an http\u002Fhttps-only address bar; the tab bar appears only once a second page is open.\u003C\u002Fp>\n\u003Ch2 id=\"where-it-stops\">Where it stops\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>\u003Cstrong>Automatic forwarding needs the plugin.\u003C\u002Fstrong> Without \u003Ccode>dsh-devtools\u003C\u002Fcode>, or with a \u003Ccode>DSH_HOME\u003C\u002Fcode> that moved the snapshot, no automatic rule is created. Manual rules still work.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Only processes descending from DSH count.\u003C\u002Fstrong> Services started with \u003Ccode>nohup &amp;\u003C\u002Fcode>, pm2, systemd, screen or tmux outside DSH, or ports published by a container, have no lineage and stay invisible — better to miss one than to forward someone else's service. Add a rule by hand.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Only your own processes are visible.\u003C\u002Fstrong> Non-root \u003Ccode>lsof\u003C\u002Fcode> lists sockets of the same user; if DSH runs in a container and you SSH into the host, ports are missed.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>The local listener is bound to \u003Ccode>127.0.0.1\u003C\u002Fcode>.\u003C\u002Fstrong> Other machines on your LAN cannot reach it.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>The SSH server must allow forwarding.\u003C\u002Fstrong> With \u003Ccode>AllowTcpForwarding no\u003C\u002Fcode> the rule fails with \u003Ccode>administratively prohibited\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Nothing is exposed to the internet.\u003C\u002Fstrong> The plugin's remote-access page can do that, after an explicit risk confirmation.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"faq\">FAQ\u003C\u002Fh2>\n\u003Cp>\u003Cstrong>The plugin is installed but no rule appears.\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cp>Read the status line first: can it not read the snapshot, or did the plugin report ports that are not listening? Usually dsh was not restarted after install, or the service was started outside DSH.\u003C\u002Fp>\n\u003Cp>\u003Cstrong>Why is the local port not 3000?\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cp>The local number was taken, or the remote port is a low one such as 82 that macOS will not let a normal user bind. The rule is still built and the log says which port it fell back to.\u003C\u002Fp>\n\u003Cp>\u003Cstrong>Will my manual rule be removed?\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cp>It participates in the remote check. Tick \u003Cstrong>Static\u003C\u002Fstrong> to keep it; a newly created rule has a 5-minute grace period.\u003C\u002Fp>\n\u003Cp>\u003Cstrong>Does this work on a phone?\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cp>Yes, with the same rule. The mobile app needs a membership ($30 per year or $90 for a lifetime v1.x licence); the desktop app is free and needs no account.\u003C\u002Fp>\n\u003Ch2 id=\"related-reading\">Related reading\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>\u003Ca href=\"\u002Fen\u002Fblog\u002Fdsh-devtools-plugin\">The dsh-devtools plugin: a dev workbench inside your remote DSH\u003C\u002Fa> — it writes the port snapshot\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"\u002Fen\u002Fblog\u002Fdsh-remote-vs-vscode-remote\">DSH Remote vs VSCode Remote: two ways to work remotely\u003C\u002Fa> — where this rule comes from\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"\u002Fen\u002Fblog\u002Fwhat-is-dsh-remote\">What is DSH Remote? The four capabilities explained\u003C\u002Fa>\u003C\u002Fli>\n\u003Cli>Docs: \u003Ca href=\"\u002Fen\u002Fdocs\u002Fguides\u002Fremote-debug\">Live debugging: see it the moment you save\u003C\u002Fa> · \u003Ca href=\"\u002Fen\u002Fdocs\u002Fguides\u002Fssh-tunnel\">When it will not connect\u003C\u002Fa>\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"\u002Fen\u002Fdownload\">Download the client\u003C\u002Fa> · \u003Ca href=\"\u002Fen\u002Fpricing\">Pricing and membership\u003C\u002Fa>\u003C\u002Fli>\n\u003C\u002Ful>\n",[102,106,109,112,115,118,121,124,127,130,133],{"level":103,"text":104,"id":105},2,"The problem it removes","the-problem-it-removes",{"level":103,"text":107,"id":108},"Three steps","three-steps",{"level":103,"text":110,"id":111},"The rule: ownership × liveness","the-rule-ownership-liveness",{"level":103,"text":113,"id":114},"Same port first","same-port-first",{"level":103,"text":116,"id":117},"Manual rules, static rules, and cleanup","manual-rules-static-rules-and-cleanup",{"level":103,"text":119,"id":120},"HMR and the Host header","hmr-and-the-host-header",{"level":103,"text":122,"id":123},"Pages that ask for a password","pages-that-ask-for-a-password",{"level":103,"text":125,"id":126},"One window, several tabs","one-window-several-tabs",{"level":103,"text":128,"id":129},"Where it stops","where-it-stops",{"level":103,"text":131,"id":132},"FAQ","faq",{"level":103,"text":134,"id":135},"Related reading","related-reading","Guides","2026-10-31T02:00:00.000Z","2026-11-03T05:04:04.000Z","Port forwarding like VSCode Remote | DSH Remote","DSH Remote forwards ports owned by DSH and really listening, keeps the same port, and supports manual rules, Host rewriting and https.","port forwarding,automatic port forwarding,SSH tunnel,VSCode Remote,DSH Remote,remote development,localhost",false,"en",[145,149,153],{"slug":146,"title":147,"publishedAt":148},"dsh-lifecycle-management","DSH lifecycle management: install, start, pin a version, roll back","2026-11-02T02:00:00.000Z",{"slug":150,"title":151,"publishedAt":152},"ssh-multi-environment","SSH multi-environment management: one profile per machine","2026-11-01T02:00:00.000Z",{"slug":154,"title":155,"publishedAt":156},"dsh-devtools-plugin","dsh-devtools: a dev workbench inside your remote DSH","2026-10-30T02:00:00.000Z"]