V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  Koril  ›  全部回复第 2 页 / 共 3 页
回复总数  47
1  2  3  
2024-10-14 17:17:23 +08:00
回复了 Koril 创建的主题 Java 咨询贴: Java8 -> Java17, Springboot2.x -> Springboot3.x
@sumarker 兄弟这个我知道,所以省略号是什么意思😂
2024-10-14 17:14:45 +08:00
回复了 Koril 创建的主题 Java 咨询贴: Java8 -> Java17, Springboot2.x -> Springboot3.x
@Leviathann 我刚想问这个哈哈哈哈,直接上 21 是不是更好,一步到胃,接触新的东西多么,之前学 Java8 ,看了本《 Java 8 in Action 》就差不多熟悉了,8 -> 21 有什么比较友好的资料么
昨天刚看完汤浅政明的《心理游戏》。
当我们有手有脚,倘若还有一丝能选择的机会,就有无限可能,不必和他人比较,把整个世界和人生当成一场属于自己的“游戏”,无论从几岁开始都不晚。
2024-10-01 13:30:59 +08:00
回复了 Koril 创建的主题 分享发现 看到一篇博客,是关于学习编程语言的建议,分享下
@sir283 作为受雇的工作者而言,现场解决问题的工程经验确实是最重要的,毕竟客户的问题,那就是当下最真实的目的,如果现场还能再外包出去(假设有人能更快更好地解决),我可能都不会选择语言,直接让别人做,然后付钱 hhhhhh 。
2024-10-01 13:23:14 +08:00
回复了 Koril 创建的主题 分享发现 看到一篇博客,是关于学习编程语言的建议,分享下
@billzhuang 作者把这篇文章发到了论坛平台以及自己的个人博客上
2024-09-29 15:25:15 +08:00
回复了 tool2dx 创建的主题 随想 编程超人
编程大部分情况是为了解决某些具体的问题,问题本身可能是很有意义的。
为了在维护项目这个枯燥的过程中不那么苦闷,不得不开始寻找或者赋予工具(比如编程)意义。
2024-09-27 21:44:40 +08:00
回复了 Koril 创建的主题 问与答 关于 Clash、curl、 Python pip/requests/httpx 代理的一些困惑
补充:Clash 打开系统代理,注册表的 ProxyEnable 变成 1 ,反之为 0 ,urllib.request 的 getproxies_registry() 就是拿这个变量来判断的。
2024-09-27 21:36:47 +08:00
回复了 Koril 创建的主题 问与答 关于 Clash、curl、 Python pip/requests/httpx 代理的一些困惑
@Abbeyok ok ,我去了解下什么是 tun 模式
2024-09-27 21:36:17 +08:00
回复了 Koril 创建的主题 问与答 关于 Clash、curl、 Python pip/requests/httpx 代理的一些困惑
@proxytoworld 好的
2024-09-27 21:34:25 +08:00
回复了 Koril 创建的主题 问与答 关于 Clash、curl、 Python pip/requests/httpx 代理的一些困惑
然后就读取到了 ProxyServer 127.0.0.1:7890 这个键值对,然后在末尾的 else 块中,擅自加上了 https ,最后返回的 proxy 变成了:
{
'ftp': 'ftp://127.0.0.1:7890',
'http': 'http://127.0.0.1:7890',
'https': 'https://127.0.0.1:7890'
}
而 Clash 的代理是 http 代理,所以第三个键值对 https: https://127.0.0.1:7890 会引发 ProxyError 异常,显示无法连接到该代理,正确的键值对应该是 https: http://127.0.0.1:7890 。

这是我目前的一点点理解。
2024-09-27 21:23:32 +08:00
回复了 Koril 创建的主题 问与答 关于 Clash、curl、 Python pip/requests/httpx 代理的一些困惑
感谢大家的回复,晚上回家翻了下源码,这里我自问自答下:

关于第二个问题:为什么 Windows 开了 Clash 的系统代理,使用 requests 如果不显示的设置 proxies 这个参数(无论是方法传参,还是设置环境变量)就无法请求的问题。

requests 的 sessions 模块的 merge_environment_settings() 方法调用了 Python 自带的 urllib 库中的 request 模块的 getproxies() 方法。

似乎顺序是这样的:方法传参 > 环境变量 > 注册表

如果方法没传参,环境变量也没有设置 http/https_proxy 的话,代码走到以下 elif 块中,去读 Windows 的注册表:

```
elif os.name == 'nt':
def getproxies_registry():
"""Return a dictionary of scheme -> proxy server URL mappings.

Win32 uses the registry to store proxies.

"""
# 省略部分代码
try:
# 查询 win 注册表
internetSettings = winreg.OpenKey(winreg.HKEY_CURRENT_USER,
r'Software\Microsoft\Windows\CurrentVersion\Internet Settings')
proxyEnable = winreg.QueryValueEx(internetSettings,
'ProxyEnable')[0]
if proxyEnable:
# Returned as Unicode but problems if not converted to ASCII
proxyServer = str(winreg.QueryValueEx(internetSettings,
'ProxyServer')[0])
if '=' in proxyServer:
# Per-protocol settings
for p in proxyServer.split(';'):
protocol, address = p.split('=', 1)
# See if address has a type:// prefix
if not re.match('^([^/:]+)://', address):
address = '%s://%s' % (protocol, address)
proxies[protocol] = address
else:
# Use one setting for all protocols
if proxyServer[:5] == 'http:':
proxies['http'] = proxyServer
else:
proxies['http'] = 'http://%s' % proxyServer
proxies['https'] = 'https://%s' % proxyServer
proxies['ftp'] = 'ftp://%s' % proxyServer
internetSettings.Close()


return proxies
```
2024-09-27 15:36:49 +08:00
回复了 Koril 创建的主题 问与答 关于 Clash、curl、 Python pip/requests/httpx 代理的一些困惑
@proxytoworld hhh 抽象么,可能因为我是个初学者,提的问题比较奇怪。
2024-09-13 21:03:44 +08:00
回复了 Koril 创建的主题 PostgreSQL 关于 PostgreSQL 中的 max_connections 和 pg_stat_activity 的疑惑
@ampedee 我找了下,应该指的是 backend_type 字段吧,SQL 加个 where backend_type = 'client backend' 数量就对象了。
2024-01-29 14:43:19 +08:00
回复了 Koril 创建的主题 计算机 2024 年想换台笔记本,老哥们有什么推荐?
@ZxykM 这个感觉不错。
2024-01-29 14:38:12 +08:00
回复了 Koril 创建的主题 计算机 2024 年想换台笔记本,老哥们有什么推荐?
昨天看到,ThinkPad 的 T14p ,好像是板载 32 GB ,感觉有点可惜
2024-01-29 14:35:04 +08:00
回复了 Koril 创建的主题 计算机 2024 年想换台笔记本,老哥们有什么推荐?
@jaycelhz 液金会有问题么,日常背来背去的
2024-01-29 14:08:23 +08:00
回复了 Koril 创建的主题 计算机 2024 年想换台笔记本,老哥们有什么推荐?
@Yanlongli 是的,在主板限制的情况下,有多大我加多大
2024-01-29 14:06:05 +08:00
回复了 Koril 创建的主题 计算机 2024 年想换台笔记本,老哥们有什么推荐?
@xingdaorong 哈哈哈现在暂时不考虑 MBP ,以后可能会买来玩玩的
2024-01-29 14:04:36 +08:00
回复了 Koril 创建的主题 计算机 2024 年想换台笔记本,老哥们有什么推荐?
@aofall 好黑屏问题我会去看看,现在暗影精灵 2Pro 的鼓包问题,前两年确实遇到了,也是当时没做好调研
1  2  3  
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   3333 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 24ms · UTC 04:49 · PVG 12:49 · LAX 20:49 · JFK 23:49
♥ Do have faith in what you're doing.