Code Monkey home page Code Monkey logo

Comments (13)

bytemain avatar bytemain commented on July 19, 2024

是一个包 叫 httpie
你也可以改成 curl https://api.ip.sb/geoip/$1

就是来获取当前 ip 地址的

from dotfiles.

Yiyiyimu avatar Yiyiyimu commented on July 19, 2024

多谢多谢,最开始没有看明白

from dotfiles.

Yiyiyimu avatar Yiyiyimu commented on July 19, 2024

不好意思再打扰一下,不知道当时有没有碰到过,代理开启局域网,配置好WSL内部的代理之后提示curl: (52) Empty reply from server,好像是连不到windows端

还有想问一下,为什么PROXY_HTTP和PROXY_SOCKS5用了两个不同的端口

from dotfiles.

bytemain avatar bytemain commented on July 19, 2024
  1. 是请求哪个网站出现的这个 empty reply
    我遇到过是因为我的代理接管了DNS,所以DNS解析就不走 hosts 了,将自己需要的域名 bypass 掉即可。

  2. 我用的代理软件是 clash,默认是支持两个模式不同端口的。

from dotfiles.

Yiyiyimu avatar Yiyiyimu commented on July 19, 2024

感谢这么快的回复!
所有网站都是empty reply,墙内外都是,我外侧代理开的也是全局的。不好意思可以讲详细一点怎么bypass自己的域名吗,好像没有搜到相关解决方法。

  1. 噢clash还有这个功能

from dotfiles.

bytemain avatar bytemain commented on July 19, 2024

看一下 curl google.com -vvv 输出的内容是不是走了代理。
走了代理的话看看是不是 windows 防火墙的问题(我是直接关了的)。

代理配置:
看你的用的是什么代理软件,比如我现在用 clash,我想让某个域名(假设 artin.wsl)不被代理,我就修改我的配置文件:

Rule:
# 添加下面一句即可
- DOMAIN-SUFFIX,artin.wsl,DIRECT

其他代理软件你可以自己摸索怎么配置规则

from dotfiles.

Yiyiyimu avatar Yiyiyimu commented on July 19, 2024

嗯走了代理,也不是防火墙的问题。我换了proxychains还是不行,我再试试其他方法。
多谢多谢

from dotfiles.

bytemain avatar bytemain commented on July 19, 2024

刚突然想到,有时候 windows 开启的 程序监听的可能是 [::]
也就是监听的是 ipv6 地址。
只是给你参考一下

from dotfiles.

Yiyiyimu avatar Yiyiyimu commented on July 19, 2024

microsoft/WSL#4983 (comment)
microsoft/WSL#4210 (comment)

谢谢,我翻issue也看到不少有说监听的是ipv6地址,想问一下如果是这样的话有什么办法能解决吗


另外我尝试了以下换成clash,
v2ray报错

$ curl -vv baidu.com
* Rebuilt URL to: baidu.com/
*   Trying 172.31.0.1...
* TCP_NODELAY set
* Connected to 172.31.0.1 (172.31.0.1) port 7890 (#0)
> GET http://baidu.com/ HTTP/1.1
> Host: baidu.com
> User-Agent: curl/7.58.0
> Accept: */*
> Proxy-Connection: Keep-Alive
>
* Empty reply from server
* Connection #0 to host 172.31.0.1 left intact
curl: (52) Empty reply from server

clash报错

$ curl -vv baidu.com
* Rebuilt URL to: baidu.com/
*   Trying 172.31.0.1...
* TCP_NODELAY set
### hang here
* connect to 172.31.0.1 port 7890 failed: Connection timed out
* Failed to connect to 172.31.0.1 port 7890: Connection timed out
* Closing connection 0
curl: (7) Failed to connect to 172.31.0.1 port 7890: Connection timed out

在外部powershell里都能curl的通,之前在v2ray没有开允许局域网连接的时候也有time out的报错,是clash除了需要开Allow LAN以外还需要什么其他的设置吗

from dotfiles.

bytemain avatar bytemain commented on July 19, 2024

手动设置监听 0.0.0.0

from dotfiles.

bytemain avatar bytemain commented on July 19, 2024

clash 只开 allow lan 即可。
注意看看是不是 windows 防火墙的问题。

from dotfiles.

Yiyiyimu avatar Yiyiyimu commented on July 19, 2024

哇终于对了。

最后是用clash的时候看netstat看到只监听了ipv6没有监听ipv4,去看防火墙的确没有开,打开之后就可以用了。但v2ray防火墙也是开着的就用不了还没搞清楚为什么。

非常感谢老哥不厌其烦回答我这么多问题!祝学业顺利!!

from dotfiles.

bytemain avatar bytemain commented on July 19, 2024

没事没事~ 也祝你学业顺利

from dotfiles.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.