AI Beginner's Guide: How to Set Up Command-Line Proxy (Temporary & Permanent Methods)
Support Content
## 1. Commands used in the video
> 1.1 One-time proxy setup
```
export https_proxy=http://127.0.0.1:7890
```
> 2.1 Status test
```
echo $https_proxy
```
> 2.2 Access test
```
curl -I https://www.google.com
```
> 3. Cancel proxy settings
```
unset https_proxy # for https
unset http_proxy # for http
```
> 4. Reusable proxy settings
> 4.1 Edit file
```
vi ~/.zshrc
```
> 4.2 Add content
```
# Proxy on function // Proxy on
proxy_on() {
export http_proxy=http://127.0.0.1:7890
export https_proxy=http://127.0.0.1:7890
export all_proxy=socks5://127.0.0.1:7890
echo "proxy on, close by - proxy_off"
}
# Always run //always on
proxy_on
# Proxy off function // Proxy off
proxy_off() {
unset http_proxy https_proxy all_proxy
echo "proxy off"
}
```
Summary Content
# AI Beginner's Guide: How to Set Up Command-Line Proxy (Temporary & Permanent Methods)
## Overcome Network Errors: The Complete Guide to Command-Line Proxies for AI Beginners
When diving into the vast world of Artificial Intelligence (AI), many beginners face a common roadblock: network restrictions preventing access to essential resources, libraries, or models. This issue can often be resolved by setting up a proxy for your command line (Terminal). This video provides a step-by-step tutorial on how to configure your proxy, allowing you to focus on learning and creating, not on troubleshooting network issues.
### Why Set a Proxy for the Command Line?
Many AI tools, package managers (like pip, conda), and version control systems (like Git) require command-line access to international web resources. If your network environment is restricted, you'll encounter download failures, connection timeouts, and other frustrating errors that hinder your learning and development efficiency. Learning to set up a proxy is a fundamental skill for every developer.
### Method 1: The Quick & Temporary Proxy
This method is the simplest and is perfect for temporary tasks. The proxy settings are only active in the current terminal window and will be gone once the window is closed.
**Key Steps:**
1. **Set the Proxy**: Run the following command in your terminal, replacing the IP address and port with your own proxy details.
```bash
export https_proxy=http://127.0.0.1:7890
export http_proxy=http://127.0.0.1:7890
```
2. **Verify the Proxy**: Check if the variable was set correctly with the `echo $https_proxy` command.
3. **Test the Connection**: Use a command like `curl -I https://www.google.com` to test network connectivity.
4. **Unset the Proxy**: Once you're done, you can disable the proxy using `unset https_proxy`.
**Pros**: Simple, on-demand, and doesn't affect other system settings.
**Cons**: Needs to be re-configured every time you open a new terminal window.
### Method 2: The Set-it-and-Forget-it Automated Proxy
If you need to use a proxy frequently, an automated configuration is a more efficient solution. By modifying your shell's configuration file (e.g., `~/.zshrc` or `~/.bash_profile`), you can make your terminal automatically set up the proxy on startup and provide simple commands to toggle it on or off.
**Core Idea:**
1. **Locate the Config File**: Find the configuration file corresponding to your shell (e.g., `~/.zshrc` for Zsh on macOS).
2. **Add Proxy Functions**: Add pre-written function scripts to the end of the file. These typically include `proxy_on` (to enable the proxy) and `proxy_off` (to disable it).
```shell
# Proxy Functions
function proxy_on() {
export https_proxy=http://127.0.0.1:7890
export http_proxy=http://127.0.0.1:7890
echo \"Proxy has been enabled.\"
}
function proxy_off() {
unset https_proxy
unset http_proxy
echo \"Proxy has been disabled.\"
}
```
3. **Set Default Behavior**: You can choose to call `proxy_on` by default in the script for an always-on proxy, or leave it out and manually type `proxy_on` when needed.
**Pros**: Configure once, use forever. Easily control the proxy with simple commands.
**Cons**: Initial setup is slightly more complex and requires a basic understanding of terminal principles.
---
Mastering these proxy configuration skills will remove a major obstacle on your AI learning journey. We hope this video helps you enter the world of AI more smoothly!
Related Contents
Major News: Google Gemini 3.1 ...
Duration: 00:00 | DPOpenAI's Surprise Move? Free C...
Duration: 00:00 | DPMajor Change to GitHub Copilot...
Duration: 00:00 | DPAntigravity Pro Plan Reversal:...
Duration: 00:00 | DPAntigravity Pro Plan Quotas Sl...
Duration: 00:00 | DPOpenAI Shakes Up Codex: Free A...
Duration: 00:00 | DPGoogle Antigravity's March 202...
Duration: 00:00 | DPGoogle Antigravity Account Ban...
Duration: 00:00 | DPAntigravity Mass Unban: Crisis...
Duration: 00:00 | DPIs the Antigravity Pro Quota I...
Duration: 00:00 | DPGoogle AI IDE Antigravity: Dee...
Duration: 00:00 | DPClaude Opus 4.6 on Antigravity...
Duration: 00:00 | DPAntigravity Not Working? Solve...
Duration: 00:00 | DPAI Showdown: Codex 5.3 vs. Opu...
Duration: 00:00 | DPAntigravity Skills Beginner's ...
Duration: 00:00 | DPThe Ultimate Guide to Customiz...
Duration: 00:00 | DPDeep Dive: Google AI IDE Antig...
Duration: 00:00 | DPAntigravity Quota Drastically ...
Duration: 00:00 | DPAntigravity Perfect Dark Theme...
Duration: 00:00 | DPAntigravity Quota In-Depth Ana...
Duration: 00:00 | DPAntigravity Tip: Disable Autom...
Duration: 00:00 | DPAntigravity Better AI Model Qu...
Duration: 00:00 | DPAntigravity Update: New Free G...
Duration: 00:00 | DPAntigravity Lag Fix: Enable Pe...
Duration: 00:00 | DPRecommended
iEVE Ship Fragment Refining Ca...
08:04 | 93iEVE Original - EVE Mobile Game EVE Echoes, dedica...
Claude Code Conversation Recov...
02:48 | 306Methods for restoring interrupted conversations in...
Free SSL Docker acme.sh: Wildc...
11:10 | 681Based on Synology 7.2.1 system, the process of ins...
Jellyfin Enable HTTPS Access o...
08:57 | 171Synology 7.2 System: How to Configure Jellyfin to ...