---
title: "代理服务器相关"
author: "Perrin Yong"
author_profile: https://www.pystone.net/profile/
published_by: "Perrin Yong"
canonical: https://www.pystone.net/notes/proxy-server-basics/
type: note
content_role: unspecified
visibility: public
id_stability: rename-stable
source_path: "10-计算机、信息技术与工程/01-系统基础与网络安全/网络工程/代理服务器相关.md"
content_hash: fec1ab2b30fd94d84f2d6b39d0d518fd6ff074471e6334aac11f2352ac965e4f
knowledge_version: 224c990773de.5fa8af6e39fa
site_commit: 224c990773de166d23a886306577dd90379529ce
notes_commit: 5fa8af6e39fa3891d1b9b4832bfa6c4e0ecaaf0a
---
# 代理服务器相关

﻿# 代理服务器相关

> 创建时间：2021/5/14 10:44

* Introduction
    * 用处
      * 保护隐私
      * 防火墙
    * Proxy vs NAT
  * Ref

## Introduction

代理服务器 (Proxy server) : In computer networking, a proxy server is a server application or appliance that acts as an intermediary for requests from clients seeking resources from servers that provide those resources.

![assets/0003 - 代理服务器相关__resource-001-5890cabb3812.png](/media/081fbacc2df8fc6453b4.png)

![assets/0003 - 代理服务器相关__resource-002-5a2eb7e19fdc.png](/media/d96a616879f8c6254a10.png)

### 用处

#### 保护隐私

proxies can be used to protect privacy - on behalf of the client when requesting service, potentially masking the true origin of the request to the resource server.

客户端向外部要求的资料事实上都是 Proxy 帮用户取得的，因此因特网上面看到要求数据者，将会是 Proxy 服务器的 IP 而不是客户端的 IP

#### 防火墙

由于整个因特网对外都是经过 proxy ，也就是『单点对外』的情况，这种状态底下要来管理防火墙也是比较简单的

### Proxy vs NAT

NAT服务器的功能 - Linux 的 NAT 功能主要透过封包过滤的方式， 并使用 iptables 的 nat 表格进行 IP 伪装 (SNAT) ，让客户端自行前往因特网上的任何地方的一种方式。主要的运作行为是在 OSI 七层协定的 **二、三、四** 层（数据链路层，网络层，传输层）。由于是透过封包过滤与伪装，因此客户端可以使用的端口号码 (第四层) 较弹性；

Proxy 服务器的功能 - 主要透过 Proxy 的服务程序 (daemon) 提供网络代理的任务，因此 Proxy 能不能进行某些工作，与该服务的程序功能有关。 举例来说，如果你的 Proxy 并没有提供邮件或 FTP 代理，那么你的客户端就是无法透过 Proxy 去取得这些网络资源。 主要运作的行为在 OSI 七层协议的 **应用层** 部分 (所谓的比较"高阶"之意)。

## Ref

http://shouce.jb51.net/vbird-linux-server-3/123.html
https://en.wikipedia.org/wiki/Proxy_server
