📘
Deuterium Wiki
  • Hello
  • Linux
    • cmd
      • du: 显式文件大小
      • seq: 生成序列
      • cat: 连接
      • cp: 复制
      • cd: 切换目录
      • mv: 移动
    • awk
      • 执行awk脚本
      • 删除空行
      • 个数统计
      • 文件的交集
      • 文件的差集
    • mysql
      • 删除重复数据
      • 导出数据不带标题
  • Reading
    • Novel
      • 《基督山伯爵》人物关系
    • Awesome CS Books
      • csapp-3e-homework-solution
        • 1. A Tour of Computer Systems
        • 2. Representing and Manipulating Information
          • 2.55 Compile and Run
          • 2.56 Another Try
          • 2.57 More show Procedures
          • 2.58 Check Little-Endian
          • 2.59 Bit Expressions
          • 2.60 Replace Byte
          • 2.61 More Bit Expressions
          • 2.62 Check Arithmetic Right Shift
          • 2.63 Logic & Arithmetic Right Shift
          • 2.64 Any Odd One
          • 2.65 Odd Ones
          • 2.66 Leftmost One
          • 2.67 Int Size is 32
          • 2.68 Lower One Mask
          • 2.69 Rotate Left
          • 2.70 Fits Bits
          • 2.71 Xbyte
          • 2.72 Copy Int
          • 2.73 Saturating Add
          • 2.74 Sub OK
          • 2.75 Unsigned High Prod
          • 2.76 calloc
          • 2.77 Multiple By Shifts
          • 2.78 Divide Power 2
          • 2.79 Mul3div4
          • 2.80 Three Fourths
          • 2.81 Generate Bits
          • 2.82 Signed and Unsigned
          • 2.83 Binary Floating Value
          • 2.84 Float Le
          • 2.85 Floating Point I
          • 2.86 Extend Precision
          • 2.87 Floating-Point II
          • 2.88 Floating-Point III
          • 2.89 Floating-Point IV
          • 2.90 fpwr2
          • 2.91 π
          • 2.92 Float Negate
          • 2.93 Float Absval
          • 2.94 Float Twice
          • 2.95 Float Half
          • 2.96 Float f2i
          • 2.97 Float i2f
        • 3. Machine-Level Representation of Programs
          • 3.58 Decode
          • 3.59 128-bit Multiply
          • 3.60 For Loop
          • 3.61 Conditional Data Transfer
          • 3.62 Switch I
          • 3.63 Switch II
          • 3.64 Multiple Dimension Array I
          • 3.65 Multiple Dimension Array II
          • 3.66 Multiple Dimension Array III
          • 3.67 Caller and Callee
          • 3.68 Alignment
          • 3.69 Struct
          • 3.70 Union
          • 3.71 fgets
          • 3.72 Variable-Size Stack
          • 3.73 Find Range I
          • 3.74 Find Range II
          • 3.75 Complex
      • tcpv1
        • ch01: Introduction
        • ch02: Link Layer
        • ch03: Internet Protocol
        • ch04: Address Resolutin Protocol
        • ch05: Reverse Address Resolution Protocol
        • ch06: Internet Control Message Protocol
        • ch07: Ping Program
        • ch08: Traceroute Program
        • ch09: IP Routing
        • ch10: Dynamic Routing Protocols
        • ch11: User Datagram Protocol
        • ch12: Broadcasting and Multicasting
        • ch13: Internet Group Management Protocol
        • ch14: The Domain Name System
        • ch15: Trivial File Transfer Protocol
        • ch16: Boostrap Protocol
        • ch17: Transmission Control Protocol
        • ch18: TCP Connection Establishment and Termination
        • ch 19: TCP Interactive Data Flow
        • ch20: TCP Bulk Data Flow
      • http
        • ch01: Overview of HTTP
        • ch02: URLs and Resources
        • ch03: HTTP Messages
        • ch04: Connection Management
        • ch05: Web Servers
        • ch06: Proxies
        • ch07: Caching
        • ch08: Integration Points
        • ch09: Web Robots
        • ch10: HTTP-NG
        • ch11: Client Identification and Cookies
        • ch12: Basic Authentication
        • ch13: Digest Authentication
        • ch14: Secure HTTP
        • ch15: Entities and Encodings
        • ch16: Internationalizated
        • ch17: Content Negotiation and Transcoding
        • ch18: Web Hosting
        • ch19: Publishing Systems
        • ch20: Redirections and Load Balancing
        • ch21: Logging and Usage Tracking
    • 提升认知
      • 《为什么需要生物学思维》
      • 《大话西方艺术史》
  • Mathematics
Powered by GitBook
On this page
  • 1. Web Intermediaries
  • 1.2 Private and Shared Proxies
  • 1.3 Proxies Versus Gateways
  • 2. Why Use Proxies?
  • 2.1 Chile Filter
  • 2.2 Document Access Controller
  • 2.3 Security Firewall
  • 2.4 Web Cache
  • 2.5 Transcoder
  • 2.6 Anonymizer
  • 3. Where Do Proxies Go?
  • 3.1 Proxy Server Deployment
  • 3.2 Proxy Hierarchies
  • 3.3 How Proxies Get Traffic
  • 4. Tricky Things About Proxy Requests
  • 4.1 Proxy URIs Differ from Server URIs
  • 4.2 The Same Problem with Virtual Hosting
  • 4.3 Intercepting Proxies Get Partial URIs
  • 4.4 Proxies Can Handle Both Proxy and Server Requests
  • 4.5 In-Flight URI Modification
  • 5. Tracing Messages
  • 5.1 The Via Header
  • 5.2 The TRACE Method
  • 6. Proxy Authentication
  • 7. Proxy Interoperation
  • 7.1 OPTIONS: Discovering Optional Feature Support
  • 7.2 The Allow Header

Was this helpful?

  1. Reading
  2. Awesome CS Books
  3. http

ch06: Proxies

Previousch05: Web ServersNextch07: Caching

Last updated 4 years ago

Was this helpful?

6.代理

1. Web Intermediaries

HTTP proxy servers are both web servers and web clients.

1.2 Private and Shared Proxies

Proxies dedicated to a single client are called private proxies.

Proxies shared among numerous clients are called public proxies.

1.3 Proxies Versus Gateways

Proxies connect two or more applications that speak the same protocol.

While gateways hook up two or more parties that speak different protocols.

2. Why Use Proxies?

2.1 Chile Filter

The proxy permit unrestricted access to educational content but forcibly deny access to stites that are inappropriate for children.

2.2 Document Access Controller

Proxy servers can be used to implement a uniform access-control strategy across a large set of web servers and web resources and to create an audit trail.

2.3 Security Firewall

Use proxy servers to enhance security.

2.4 Web Cache

Proxy caches maintain local copies of popular documents and serve them on demand, recuding slow and costly Internet communication.

2.5 Transcoder

Proxy servers can modify the body format of content before delivering it to clients.

2.6 Anonymizer

Anonymizer proxies provide heightened privacy and anonymity, by actively removing identifying characteristics from HTTP messages.

3. Where Do Proxies Go?

  • How proxies can be deployed into networks?

  • How proxies can chain together into hierarchies?

  • How traffic gets directed to a proxy server in the first place?

3.1 Proxy Server Deployment

You can place proxies in all kinds of places, depending on their intended uses.

  • Egress Proxy: stick proxies at the exit points of local networks to control the traffic flow between the local network and the greater Internet.

  • Access(ingress) Proxy: proxies are often placed at ISP access points, processing the aggregate request from the customers.

  • Surrogates(reverse proxies): proxies frequently are deployed as surrogates at the edge of the network, in front of web servers.

  • Network Exchange Proxy: proxies can be placed in the Internet peering exchange points between networks.

3.2 Proxy Hierarchies

Proxies can be cascaded in chains.

3.3 How Proxies Get Traffic

  • Modify the client: configure the client to use proxy;

  • Modify the network: configure the router to intercepts and redirects traffic to proxy;

  • Modify the DNS namespace: configure the proxy to be the web server;

  • Modify the web server: web server redirects the request to proxy.

4. Tricky Things About Proxy Requests

Some tricky and much misunderstood aspects of proxy server requests.

4.1 Proxy URIs Differ from Server URIs

When the client is not set tot use a proxy, it sends the partial URI.

When the client is set to use a proxy, it sends the full URI.

4.2 The Same Problem with Virtual Hosting

Virtually hosted web servers share the same physical web server among many web sites.

When a request comes in for the partial URI /index.html, the virtually hosted web server needs to know the hostname of the inteded web site.

  • Explicit proxies solve the problem by requiring a full URI in the request message.

  • Virtually hosted web servers require a Host header to carry the host and port information.

4.3 Intercepting Proxies Get Partial URIs

Client will not know it is talking to a proxy.

4.4 Proxies Can Handle Both Proxy and Server Requests

General-purpose proxy servers should support both full URIs and partial URIs in request messages.

Rules:

  • If a full URI is provided, the proxy should use it.

  • If a partial URI is provided, and a Host header is present, the Host header should be used to determine the origin server name and port number.

  • If a partial URI is provided, and there is no Host header, the origin server needs to be determined in some other way:

    • If the proxy is a surrogate, standing in for an origin server, the proxy can be configured with the real server's address and port number.

    • If the traffic was intercepted, and the interceptor makes the original IP address and port available, the proxy can use the IP address and port number from the interception technology.

    • If all else fails, the proxy doesn't have enough information to determine the origin server and must return an error message.

4.5 In-Flight URI Modification

Proxy serves need to be very careful about chaning the request URI as they forward messages.

5. Tracing Messages

A request may go through many proxies, sometimes we need to know what proxies a message go through.

5.1 The Via Header

5.1 Via syntax

Via: 1.1 proxy-62.irenes-isp.net, 1.0 cache.joes-hardware.com

5.1.2 Via request and response paths

5.1.3 The Server and Via headers

The Server response header field describes the software used by the origin server.

Server: Apache/1.3.14 (Unix) PHP/4.0.4
Server: Netscape-Enterprise/4.1
Server: Microsoft-IIS/5.0

5.2 The TRACE Method

TRACE method just likes the traceroute.

5.2.1 Max-Forwards

Max-Forwards limits the number of proxy hops for TRACE and OPTIONS request.

6. Proxy Authentication

7. Proxy Interoperation

If a proxy is unfamiliar with a method, it should try to forward the message to the next hop, if possible.

7.1 OPTIONS: Discovering Optional Feature Support

OPTIONS method lets a client discover the supported functionality of a web server or of a particular resource on a web servesr.

7.2 The Allow Header

The Allow entity header field lists the set of methods supported by the resource identified by the request URI, or the entire server if the request URI is *.

Allow: GET, HEAD, PUT