get the default proxy by Powershell

本文介绍如何在PowerShell中设置系统代理并使用代理发送HTTP请求。通过获取注册表中的代理地址,创建WebProxy对象,并将其应用于WebClient实例,从而实现通过代理访问指定网址并下载网页数据。

https://stackoverflow.com/questions/571429/powershell-web-requests-and-proxies

$proxyAddr = (get-itemproperty 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings').ProxyServer
$proxy = new-object System.Net.WebProxy
$proxy.Address = $proxyAddr
$proxy.useDefaultCredentials = $true

$url = "http://stackoverflow.com"
$wc = new-object system.net.WebClient
$wc.proxy = $proxy
$webpage = $wc.DownloadData($url)
$str = [System.Text.Encoding]::ASCII.GetString($webpage)
Write-Host $str

 

转载于:https://www.cnblogs.com/chucklu/p/9705641.html

After restarting ComfyUI, please refresh the browser. translate\translate.go:25:2: github.com/abadojack/whatlanggo@v1.0.1: Get "https://proxy.golang.org/github.com/abadojack/whatlanggo/@v/v1.0.1.zip": dial tcp 142.251.33.81:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. translate\translate.go:28:2: github.com/andybalholm/brotli@v1.1.0: Get "https://proxy.golang.org/github.com/andybalholm/brotli/@v/v1.1.0.zip": dial tcp 142.251.33.81:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. translate\translate.go:26:2: github.com/imroc/req/v3@v3.48.0: Get "https://proxy.golang.org/github.com/imroc/req/v3/@v/v3.48.0.zip": dial tcp 142.251.33.81:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. translate\translate.go:29:2: github.com/tidwall/gjson@v1.14.3: Get "https://proxy.golang.org/github.com/tidwall/gjson/@v/v1.14.3.zip": dial tcp 142.251.33.81:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. service\service.go:23:2: github.com/gin-contrib/cors@v1.6.0: Get "https://proxy.golang.org/github.com/gin-contrib/cors/@v/v1.6.0.zip": dial tcp 142.251.33.81:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. service\service.go:24:2: github.com/gin-gonic/gin@v1.9.1: Get "https://proxy.golang.org/github.com/gin-gonic/gin/@v/v1.9.1.zip": dial tcp 142.251.33.81:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. [ComfyUI-Manager] Failed to perform initial fetching 'custom-node-list.json': Traceback (most recent call last): File "C:\Documents\Ai\ComfyUI-aki\ComfyUI-aki-v1.6\python\Lib\site-packages\aiohttp\streams.py", line 347, in _wait await waiter asyncio.exceptions.CancelledError The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Documents\Ai\ComfyUI-aki\ComfyUI-aki-v1.6\ComfyUI\custom_nodes\comfyui-manager\glob\manager_server.py", line 1729, in get_cache json_obj = await manager_util.get_data(uri, True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Documents\Ai\ComfyUI-aki\ComfyUI-aki-v1.6\ComfyUI\custom_nodes\comfyui-manager\glob\manager_util.py", line 146, in get_data json_text = await resp.text() ^^^^^^^^^^^^^^^^^ File "C:\Documents\Ai\ComfyUI-aki\ComfyUI-aki-v1.6\python\Lib\site-packages\aiohttp\client_reqrep.py", line 1260, in text await self.read() File "C:\Documents\Ai\ComfyUI-aki\ComfyUI-aki-v1.6\python\Lib\site-packages\aiohttp\client_reqrep.py", line 1218, in read self._body = await self.content.read() ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Documents\Ai\ComfyUI-aki\ComfyUI-aki-v1.6\python\Lib\site-packages\aiohttp\streams.py", line 418, in read block = await self.readany() ^^^^^^^^^^^^^^^^^^^^ File "C:\Documents\Ai\ComfyUI-aki\ComfyUI-aki-v1.6\python\Lib\site-packages\aiohttp\streams.py", line 440, in readany await self._wait("readany") File "C:\Documents\Ai\ComfyUI-aki\ComfyUI-aki-v1.6\python\Lib\site-packages\aiohttp\streams.py", line 346, in _wait with self._timer: File "C:\Documents\Ai\ComfyUI-aki\ComfyUI-aki-v1.6\python\Lib\site-packages\aiohttp\helpers.py", line 685, in __exit__ raise asyncio.TimeoutError from exc_val TimeoutError [ComfyUI-Manager] Failed to perform initial fetching 'extension-node-map.json': Traceback (most recent call last): File "C:\Documents\Ai\ComfyUI-aki\ComfyUI-aki-v1.6\python\Lib\site-packages\aiohttp\streams.py", line 347, in _wait await waiter asyncio.exceptions.CancelledError The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Documents\Ai\ComfyUI-aki\ComfyUI-aki-v1.6\ComfyUI\custom_nodes\comfyui-manager\glob\manager_server.py", line 1729, in get_cache json_obj = await manager_util.get_data(uri, True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Documents\Ai\ComfyUI-aki\ComfyUI-aki-v1.6\ComfyUI\custom_nodes\comfyui-manager\glob\manager_util.py", line 146, in get_data json_text = await resp.text() ^^^^^^^^^^^^^^^^^ File "C:\Documents\Ai\ComfyUI-aki\ComfyUI-aki-v1.6\python\Lib\site-packages\aiohttp\client_reqrep.py", line 1260, in text await self.read() File "C:\Documents\Ai\ComfyUI-aki\ComfyUI-aki-v1.6\python\Lib\site-packages\aiohttp\client_reqrep.py", line 1218, in read self._body = await self.content.read() ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Documents\Ai\ComfyUI-aki\ComfyUI-aki-v1.6\python\Lib\site-packages\aiohttp\streams.py", line 418, in read block = await self.readany() ^^^^^^^^^^^^^^^^^^^^ File "C:\Documents\Ai\ComfyUI-aki\ComfyUI-aki-v1.6\python\Lib\site-packages\aiohttp\streams.py", line 440, in readany await self._wait("readany") File "C:\Documents\Ai\ComfyUI-aki\ComfyUI-aki-v1.6\python\Lib\site-packages\aiohttp\streams.py", line 346, in _wait with self._timer: File "C:\Documents\Ai\ComfyUI-aki\ComfyUI-aki-v1.6\python\Lib\site-packages\aiohttp\helpers.py", line 685, in __exit__ raise asyncio.TimeoutError from exc_val TimeoutError FETCH ComfyRegistry Data: 5/85 FETCH ComfyRegistry Data: 10/85 FETCH ComfyRegistry Data: 15/85 FETCH ComfyRegistry Data: 20/85 FETCH ComfyRegistry Data: 25/85 FETCH ComfyRegistry Data: 30/85 FETCH ComfyRegistry Data: 35/85 FETCH ComfyRegistry Data: 40/85 FETCH ComfyRegistry Data: 45/85 FETCH ComfyRegistry Data: 50/85 FETCH ComfyRegistry Data: 55/85 FETCH ComfyRegistry Data: 60/85 FETCH ComfyRegistry Data: 65/85 FETCH ComfyRegistry Data: 70/85 FETCH ComfyRegistry Data: 75/85 FETCH ComfyRegistry Data: 80/85 FETCH ComfyRegistry Data: 85/85 FETCH ComfyRegistry Data [DONE] [ComfyUI-Manager] default cache updated: https://api.comfy.org/nodes FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json[ComfyUI-Manager] Due to a network error, switching to local mode. => custom-node-list.json => FETCH DATA from: C:\Documents\Ai\ComfyUI-aki\ComfyUI-aki-v1.6\ComfyUI\custom_nodes\comfyui-manager\custom-node-list.json [DONE] [ComfyUI-Manager] All startup tasks have been completed. [Crystools ERROR] For some reason, pynvml is not working in a laptop with only battery, try to connect and turn on the monitor [Crystools ERROR] Monitor of GPU is turning off (not on UI!) [BizyAir] Fail to get notification unread counts: Cannot connect to host api.bizyair.cn:443 ssl:default [getaddrinfo failed] 我在comfyUI中安装nunchaku有些问题 这个应该怎么修复呢
05-14
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值