『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 856|回复: 1

[经验分享] HomeAssistant OS Docker版本 直接使用代理http拉取hacs包

[复制链接]

1

主题

12

帖子

54

积分

注册会员

Rank: 2

积分
54
金钱
42
HASS币
0
发表于 2023-12-14 20:43:00 | 显示全部楼层 |阅读模式

ssh连接 os
先ping你代理所在主机确保同一个网络
 export http_proxy=http://192.168.2.54:10809

尝试curlgoogle,不要用ping,ping我这边不行。

 curl -lv google.com
* Uses proxy env variable http_proxy == 'http://192.168.2.54:10809'
*   Trying 192.168.2.54:10809...
* Connected to 192.168.2.54 (192.168.2.54) port 10809
> GET http://google.com/ HTTP/1.1
> Host: google.com
> User-Agent: curl/8.5.0
> Accept: */*
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 301 Moved Permanently
< Content-Length: 219
< Cache-Control: public, max-age=2592000
< Connection: keep-alive
< Content-Security-Policy-Report-Only: object-src 'none';base-uri 'self';script-src 'nonce-IyqdkyTNVKL4ok97aiHF8Q' 'strict-dynamic' 'report-sample' 'unsafe-eval' 'unsafe-inline' https: http:;report-uri https://csp.withgoogle.com/csp/gws/other-hp
< Content-Type: text/html; charset=UTF-8
< Date: Thu, 14 Dec 2023 12:41:29 GMT
< Expires: Sat, 13 Jan 2024 12:41:29 GMT
< Keep-Alive: timeout=4
< Location: http://www.google.com/
< Proxy-Connection: keep-alive
< Server: gws
< X-Frame-Options: SAMEORIGIN
< X-Xss-Protection: 0
<
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>
* Connection #0 to host 192.168.2.54 left intact


拉取
wget -O - https://get.hacs.xyz | bash -


这个代理不管是你手机弄得还是电脑,或者软路由,盘路由,都不影响,只要网络通了就行,

我这边走的电脑的代理。
如果不生效,重启多试几次,但是这个os有点奇怪,设置后ping google不行,

如图

如图
CLU$VTCKIS{3WC)$%[N[K_J.png
回复

使用道具 举报

1

主题

12

帖子

54

积分

注册会员

Rank: 2

积分
54
金钱
42
HASS币
0
 楼主| 发表于 2023-12-14 20:52:24 | 显示全部楼层
本帖最后由 lozn 于 2023-12-14 23:24 编辑

docker版本的hacs在集成那里会进行github授权,设置代理死活不行,通过docker外层主机 我那个openwrt全局代理才搞定的,而os版,我的dns设置为开了科学的ip,但是我nslookup测试似乎是没生效的,ping也没起作用,不知道为啥,这次执行直接就出现验证码,然后成功了 ,  curl针对 http_proxy  而 wget里面的 ,需要配置https_proxy
ping等协议
export all_proxy=socket4://192.168.2.54:10808

不过我设置没效果,ping不通。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-5-7 14:19 , Processed in 0.049973 second(s), 26 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表