美文网首页WSL
WSL 使用windows 代理

WSL 使用windows 代理

作者: kkkkkkang | 来源:发表于2020-04-08 09:32 被阅读0次

    WSL 使用windows 代理

    摘自网上总结,侵删

    #更新源
    
    sudo apt-get update
    
    #安装polipo
    
    sudo apt-get install polipo
    
    #配置文件
    
    vim /etc/polipo/config
    
    socksParentProxy = "localhost:2333" #此处2333是本地代理的监听端口
    
    socksProxyType = socks5 # socksProxyType 是 socks 类型,如果是 ss 就填上 socks5
    
    proxyPort = 8123 #proxyPort 是你想在 linux 子系统上使用的代理端口地址
    
    #编辑完成后 :wq保存,如果没有权限,要提前sudo下加权限 chmod 755 file
    
    #重启polipo
    
    service polipo stop
    
    service polipo start
    
    #设置代理端口
    
    export http_proxy=http://localhost:8123
    
    #登入 wsl 后自动开启代理
    
    vim /usr/local/sbin/polipo.sh
    
    #!/bin/bash  
    
    export http_proxy=http://localhost:8123
    
    #保存退出,编辑 ~/.bashrc 文件。
    
    vim ~/.bashrc
    
    #在文件末添加语句
    
    source /usr/local/sbin/polipo.sh
    
    #注意:本地代理需要允许来自局域网的连接
    

    相关文章

      网友评论

        本文标题:WSL 使用windows 代理

        本文链接:https://www.haomeiwen.com/subject/fodzphtx.html