Skip to content

Commit

Permalink
Bug when parsing conf file & readme
Browse files Browse the repository at this point in the history
  • Loading branch information
coyove committed Sep 9, 2017
1 parent 7333a1b commit 6b28b59
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
Binary file added .misc/console.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 19 additions & 10 deletions config/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,21 @@ func ParseConf(str string) (*conf_t, error) {
L:
for idx < len(line) {
c := line[idx]
switch c {
case '\r', '\n':

switch c {
case '[':
if e := strings.Index(line, "]"); e > 0 {
if curSection == nil {
curSection = make(map[string]interface{})
if quote == 0 {
if e := strings.Index(line, "]"); e > 0 {
if curSection == nil {
curSection = make(map[string]interface{})
}
config[line[1:e]] = curSection
break L
} else {
return nil, fmt.Errorf("invalid section name: %s at line %d", line, ln)
}
config[line[1:e]] = curSection
break L
} else {
return nil, fmt.Errorf("invalid section name: %s at line %d", line, ln)
p.WriteByte(c)
}
case ' ', '\t':
if quote != 0 {
Expand All @@ -112,9 +115,15 @@ func ParseConf(str string) (*conf_t, error) {
case '#':
if quote == 0 {
break L
} else {
p.WriteByte(c)
}
case '=':
p = value
if quote == 0 {
p = value
} else {
p.WriteByte(c)
}
default:
p.WriteByte(c)
}
Expand Down Expand Up @@ -185,6 +194,6 @@ func ParseConf(str string) (*conf_t, error) {
}

}

fmt.Println(config.GetString("misc", "zzz", ""))
return &config, nil
}
7 changes: 6 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ go run main.go -k=KEY -up=VPS_IP:8100
```
at local to connect.

Set your internet proxy to `127.0.0.1:8100` and enjoy.
Set your internet proxy to `127.0.0.1:8100` and enjoy.

## Console
There is a simple web console built inside goflyway: `http://127.0.0.1:8100/?goflyway-console`.

![](https://github.com/coyove/goflyway/blob/master/.misc/console.png?raw=true)

## Others
When comes to speed, goflyway is nearly identical to shadowsocks. But HTTP has (quite large) overheads and goflyway will hardly be faster than those solutions running on their own protocols. (If your ISP deploys QoS, maybe goflyway gets some kinda faster.)
Expand Down

0 comments on commit 6b28b59

Please sign in to comment.