Skip to content

Commit 67fcb55

Browse files
authored
Merge pull request #4 from soulteary/feat/proxy-mode-upgrade
docs: update docs
2 parents 9d5428d + f0285e6 commit 67fcb55

3 files changed

Lines changed: 15 additions & 7 deletions

File tree

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,17 @@ http_proxy=http://your-domain-or-ip-address:3142 apt-get -o pkgProblemResolver=t
4444

4545
When 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

4960
Assuming you have started a container:
@@ -80,16 +91,18 @@ View configuration items:
8091
Usage 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

cli/daemon.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ func initStore(appFlags AppFlags) (cache httpcache.Cache, err error) {
3030
}
3131

3232
func 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

proxy/proxy.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package proxy
22

33
import (
4-
"fmt"
54
"log"
65
"net/http"
76
"net/http/httputil"
@@ -25,10 +24,7 @@ type AptProxy struct {
2524
}
2625

2726
func 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{

0 commit comments

Comments
 (0)