File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,6 +44,17 @@ http_proxy=http://your-domain-or-ip-address:3142 apt-get -o pkgProblemResolver=t
4444
4545When we need to execute the above commands repeatedly in batches, the speed of update and installation ** will be greatly improved** .
4646
47+ ### Specified Mirror
48+
49+ ``` bash
50+ # proxy cache for both `ubuntu` and `debian`
51+ ./apt-proxy --ubuntu=https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ --debian=https://mirrors.tuna.tsinghua.edu.cn/debian/
52+ # proxy cache for `ubuntu` only
53+ ./apt-proxy --mode=ubuntu --ubuntu=https://mirrors.tuna.tsinghua.edu.cn/ubuntu/
54+ # proxy cache for `debian` only
55+ ./apt-proxy --mode=debian --debian=https://mirrors.tuna.tsinghua.edu.cn/debian/
56+ ```
57+
4758### Speed UP Docker Container
4859
4960Assuming you have started a container:
@@ -80,16 +91,18 @@ View configuration items:
8091Usage of apt-proxy:
8192 -cachedir string
8293 the dir to store cache data in (default " ./.aptcache" )
94+ -debian string
95+ the debian mirror for fetching packages
8396 -debug
8497 whether to output debugging logging
8598 -host string
8699 the host to bind to (default " 0.0.0.0" )
87- -mirror string
88- the mirror for fetching packages
89100 -mode all
90101 select the mode of system to cache: all / ` ubuntu` / ` debian` (default " all" )
91102 -port string
92103 the port to bind to (default " 3142" )
104+ -ubuntu string
105+ the ubuntu mirror for fetching packages
93106` ` `
94107
95108# # [WIP] Development
Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ func initStore(appFlags AppFlags) (cache httpcache.Cache, err error) {
3030}
3131
3232func initProxy (appFlags AppFlags , cache httpcache.Cache ) (ap * proxy.AptProxy ) {
33- // TODO support both ubuntu and debian
3433 ap = proxy .CreateAptProxyRouter ()
3534 ap .Handler = httpcache .NewHandler (cache , ap .Handler )
3635 return ap
Original file line number Diff line number Diff line change 11package proxy
22
33import (
4- "fmt"
54 "log"
65 "net/http"
76 "net/http/httputil"
@@ -25,10 +24,7 @@ type AptProxy struct {
2524}
2625
2726func CreateAptProxyRouter () * AptProxy {
28-
2927 mode := state .GetProxyMode ()
30- fmt .Println ("mode" , mode )
31- // TODO support both ubuntu and debian
3228 rewriter = linux .CreateNewRewriters (mode )
3329
3430 return & AptProxy {
You can’t perform that action at this time.
0 commit comments