Giter Club home page Giter Club logo

autodl_proxy's Introduction

v2raya等deb包为24/7/9能获取到的版本,除非有重大bug,本仓库不主动更新,请自行寻找最新版包

如遇到v2ray等重大安全bug欢迎提pr

本项目只做指南,提供autodl中快速科研思路,请勿用作违法用途

本项目不能教会你如何获取代理链接以及如何开启代理,请勿打扰

使用方法

首先想办法将这个项目解压在autodl-tmp文件夹下,然后执行以下

1. 安装代理软件

使用的是 v2raya,文档点这里

sudo apt install /root/autodl-tmp/autodl_proxy/installer_debian_x64_2.2.5.6.deb
sudo apt install /root/autodl-tmp/autodl_proxy/v2ray_5.16.1_amd64.deb
sudo apt install /root/autodl-tmp/autodl_proxy/xray_1.8.16_amd64.deb

v2raya

开启端口转发在本机电脑打开:$ssh -L 2017:localhost:2017 user@remote_server$

http://127.0.0.1:2017

2. 使用代理

开启代理:

export http_proxy="http://127.0.0.1:20171" && export https_proxy="http://127.0.0.1:20171"

关闭代理:

unset http_proxy && unset https_proxy

进阶使用方法,将代理开关添加到 ~/.bashrc

可以直接将 ponpoff 命令加入到 ~/.bashrc 中,这样您可以在每次启动新终端时通过输入 ponpoff 来启用或禁用代理。

以下是具体步骤:

1. 编辑 ~/.bashrc 文件

vim ~/.bashrc

2. 在文件末尾添加以下内容

# Function to enable proxy
function pon() {
    export http_proxy="http://127.0.0.1:20171"
    export https_proxy="http://127.0.0.1:20171"
    echo "Proxy enabled: $http_proxy"
    
    # Check connection to Google
    if curl -s --head --request GET http://www.google.com | grep "200 OK" > /dev/null; then 
        echo "Connection to Google successful"
    else
        echo "Failed to connect to Google"
    fi
}

# Function to disable proxy
function poff() {
    unset http_proxy
    unset https_proxy
    echo "Proxy disabled"
}

3. 保存并退出编辑器

Esc 键,然后输入 :wq 并按 Enter 键保存并退出编辑器。

4. 使更改生效

运行以下命令使更改立即生效:

source ~/.bashrc

5. 使用 ponpoff 控制代理

现在,您可以在终端中使用 ponpoff 命令来启用或禁用代理:

启用代理:

pon

禁用代理:

poff

这样,您就可以方便地在终端中控制代理的开关,而无需每次都编辑脚本文件。

autodl_proxy's People

Contributors

tt2ter avatar

Stargazers

 avatar

Watchers

 avatar

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.