Setting proxy for Windows CMD and Linux Terminal

本文详细介绍了如何在Windows CMD和Linux终端中设置HTTP和HTTPS代理,包括配置格式和具体示例,以及使用Privoxy进行SOCKS到HTTP/HTTPS的转换,适用于网络受限环境下的开发人员。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

setting proxy for Windows CMD and Linux Terminal

Linux Terminal:

set http_proxy=http://127.0.0.1:8118
set https_proxy=http://127.0.0.1:8118

set http_proxy=
set https_proxy=

more ref: Setting proxy for apt from terminal

Windows CMD:

format:

set HTTP_PROXY=http://user:password@proxy.domain.com:port

examples:

set HTTP_PROXY=http://127.0.0.1:8118
set HTTPS_PROXY=http://127.0.0.1:8118

Use Privoxy to transfer SOCKS to HTTP/HTTPS or Proxifier to manage the proxy

posted on 2019-07-26 10:17 sonictl 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/sonictl/p/11248627.html

分析如下vscode SSH连接时的报错:[09:54:45.561] Log Level: 2 [09:54:45.582] SSH Resolver called for "ssh-remote+10.170.27.158", attempt 1 [09:54:45.586] remote.SSH.useLocalServer = false [09:54:45.586] remote.SSH.useExecServer = true [09:54:45.587] remote.SSH.bindHost = {} [09:54:45.587] remote.SSH.showLoginTerminal = false [09:54:45.587] remote.SSH.remotePlatform = {} [09:54:45.587] remote.SSH.path = [09:54:45.587] remote.SSH.configFile = [09:54:45.587] remote.SSH.useFlock = true [09:54:45.587] remote.SSH.lockfilesInTmp = false [09:54:45.588] remote.SSH.localServerDownload = auto [09:54:45.588] remote.SSH.remoteServerListenOnSocket = false [09:54:45.588] remote.SSH.defaultExtensions = [] [09:54:45.590] remote.SSH.defaultExtensionsIfInstalledLocally = [] [09:54:45.591] remote.SSH.loglevel = 2 [09:54:45.591] remote.SSH.enableDynamicForwarding = true [09:54:45.591] remote.SSH.enableRemoteCommand = false [09:54:45.591] remote.SSH.serverPickPortsFromRange = {} [09:54:45.591] remote.SSH.serverInstallPath = {} [09:54:45.592] remote.SSH.permitPtyAllocation = false [09:54:45.592] remote.SSH.preferredLocalPortRange = undefined [09:54:45.592] remote.SSH.useCurlAndWgetConfigurationFiles = false [09:54:45.592] remote.SSH.experimental.chat = true [09:54:45.592] remote.SSH.experimental.enhancedSessionLogs = true [09:54:45.592] remote.SSH.httpProxy = {"*":""} [09:54:45.593] remote.SSH.httpsProxy = {"*":""} [09:54:45.600] VS Code version: 1.101.2 [09:54:45.600] Remote-SSH version: [email protected] [09:54:45.601] win32 x64 [09:54:45.604] SSH Resolver called for host: 10.170.27.158 [09:54:45.604] Setting up SSH remote "10.170.27.158" [09:54:45.617] Using commit id "2901c5ac6db8a986a5666c3af51ff804d05af0d4" and quality "stable" for server [09:54:45.617] Extensions to install: [09:54:45.623] Install and start server if needed [09:54:47.890] Checking ssh with "C:\windows\ssh.exe -V" [09:54:47.894] Got error from ssh: spawn C:\windows\ssh.exe ENOENT [09:54:47.894] Checking ssh with "C:\windows\system32\ssh.exe -V" [09:54:47.896] Got error from ssh: spawn C:\windows\system32\ssh.exe ENOENT [09:54:47.897] Checking ssh with "C:\windows\System32\Wbem\ssh.exe -V" [09:54:47.898] Got error from ssh: spawn C:\windows\System32\Wbem\ssh.exe ENOENT [09:54:47.899] Checking ssh with "C:\windows\System32\WindowsPowerShell\v1.0\ssh.exe -V" [09:54:47.900] Got error from ssh: spawn C:\windows\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT [09:54:47.901] Checking ssh with "C:\Windows\ssh.exe -V" [09:54:47.903] Got error from ssh: spawn C:\Windows\ssh.exe ENOENT [09:54:47.903] Checking ssh with "C:\Windows\system32\ssh.exe -V" [09:54:47.905] Got error from ssh: spawn C:\Windows\system32\ssh.exe ENOENT [09:54:47.905] Checking ssh with "C:\Windows\System32\Wbem\ssh.exe -V" [09:54:47.907] Got error from ssh: spawn C:\Windows\System32\Wbem\ssh.exe ENOENT [09:54:47.907] Checking ssh with "C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe -V" [09:54:47.909] Got error from ssh: spawn C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT [09:54:47.909] Checking ssh with "C:\windows\System32\WindowsPowerShell\v1.0\ssh.exe -V" [09:54:47.912] Got error from ssh: spawn C:\windows\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT [09:54:47.912] Checking ssh with "C:\windows\System32\OpenSSH\ssh.exe -V" [09:54:47.964] > OpenSSH_for_Windows_8.6p1, LibreSSL 3.4.3 [09:54:47.969] Running script with connection command: "C:\windows\System32\OpenSSH\ssh.exe" -T -D 50055 "10.170.27.158" sh [09:54:47.970] Generated SSH command: 'type "C:\Users\S50048~1\AppData\Local\Temp\vscode-linux-multi-line-command-10.170.27.158-752111106.sh" | "C:\windows\System32\OpenSSH\ssh.exe" -T -D 50055 "10.170.27.158" sh' [09:54:47.971] Using connect timeout of 17 seconds [09:54:47.971] Terminal shell path: C:\windows\System32\cmd.exe [09:54:48.820] > ssh: connect to host 0.0.0.158 port 22: Unknown error > 过程试图写入的管道不存在。 [09:54:48.821] Got some output, clearing connection timeout [09:54:50.079] "install" terminal command done [09:54:50.080] Install terminal quit with output: 过程试图写入的管道不存在。 [09:54:50.080] Received install output: 过程试图写入的管道不存在。 [09:54:50.080] WARN: $PLATFORM is undefined in installation script output. Errors may be dropped. [09:54:50.081] Failed to parse remote port from server output [09:54:50.081] Resolver error: Error at y.Create (c:\Users\s50048740\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:744751) at t.handleInstallOutput (c:\Users\s50048740\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:742832) at t.tryInstall (c:\Users\s50048740\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:865534) at async c:\Users\s50048740\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:824246 at async t.withShowDetailsEvent (c:\Users\s50048740\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:827501) at async A (c:\Users\s50048740\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:820760) at async t.resolve (c:\Users\s50048740\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:824898) at async c:\Users\s50048740\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:1113660 [09:54:50.085] ------ [09:54:50.086] No hints found in the recent session.
最新发布
07-10
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值