Skip to content

Commit 306ed42

Browse files
committed
Merge pull request #15 from getlantern/issue12
serve command line options from config file
2 parents eade807 + 7a6d560 commit 306ed42

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@ These are Lantern-specific middleware components for the HTTP Proxy in Go:
1313
* Custom responses for mimicking Apache in certain cases
1414

1515

16+
### Usage
17+
18+
Build it with `go build`.
19+
20+
To get list of the command line options, please run `http-proxy-lantern -help`.
21+
22+
`config.ini.default` also has the list of options, make a copy (say, `config.ini`) and tweak it as you wish, then run the proxy with
23+
24+
```
25+
http-proxy-lantern -config config.ini
26+
```
27+
1628
### Testing with Lantern extensions and configuration
1729

1830
### Run tests

config.ini.default

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
addr = :8080 # Address to listen
2+
https = false # Use TLS for client to proxy communication
3+
idleclose = 30 # Time in seconds that an idle connection will be allowed before closing it
4+
key = # Private key file name
5+
cert = # Certificate file name
6+
token = # Lantern token
7+
logglytoken = # Token used to report to loggly.com, not reporting if empty
8+
maxconns = 0 # Max number of simultaneous connections allowed connections
9+
enablereports = false # Enable stats reporting
10+
pprofaddr = # pprof address to listen on, not activate pprof if empty
11+
help = false # Get usage help

http_proxy.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import (
88
"os"
99
"time"
1010

11+
"github.com/vharitonsky/iniflags"
12+
1113
"github.com/getlantern/golog"
1214
"github.com/getlantern/measured"
1315

@@ -47,7 +49,7 @@ var (
4749
func main() {
4850
var err error
4951

50-
_ = flag.CommandLine.Parse(os.Args[1:])
52+
iniflags.Parse()
5153
if *help {
5254
flag.Usage()
5355
return

0 commit comments

Comments
 (0)