Skip to content

Commit

Permalink
api: add server web api for statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
fatedier committed Mar 22, 2017
1 parent 9e683fe commit a4fece3
Show file tree
Hide file tree
Showing 14 changed files with 738 additions and 426 deletions.
153 changes: 0 additions & 153 deletions client/process_udp.go.bak

This file was deleted.

1 change: 1 addition & 0 deletions cmd/frps/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,6 @@ func main() {
if config.ServerCommonCfg.PrivilegeMode == true {
log.Info("PrivilegeMode is enabled, you should pay more attention to security issues")
}
server.ServerService = svr
svr.Run()
}
28 changes: 14 additions & 14 deletions models/config/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ func NewProxyConfFromFile(name string, section ini.Section) (cfg ProxyConf, err

// BaseProxy info
type BaseProxyConf struct {
ProxyName string
ProxyType string
ProxyName string `json:"proxy_name"`
ProxyType string `json:"proxy_type"`

UseEncryption bool
UseCompression bool
UseEncryption bool `json:"use_encryption"`
UseCompression bool `json:"use_compression"`
}

func (cfg *BaseProxyConf) GetName() string {
Expand Down Expand Up @@ -139,8 +139,8 @@ func (cfg *BaseProxyConf) UnMarshalToMsg(pMsg *msg.NewProxy) {

// Bind info
type BindInfoConf struct {
BindAddr string
RemotePort int64
BindAddr string `json:"bind_addr"`
RemotePort int64 `json:"remote_port"`
}

func (cfg *BindInfoConf) LoadFromMsg(pMsg *msg.NewProxy) {
Expand Down Expand Up @@ -178,8 +178,8 @@ func (cfg *BindInfoConf) check() (err error) {

// Domain info
type DomainConf struct {
CustomDomains []string
SubDomain string
CustomDomains []string `json:"custom_domains"`
SubDomain string `json:"sub_domain"`
}

func (cfg *DomainConf) LoadFromMsg(pMsg *msg.NewProxy) {
Expand Down Expand Up @@ -235,8 +235,8 @@ func (cfg *DomainConf) check() (err error) {
}

type LocalSvrConf struct {
LocalIp string
LocalPort int
LocalIp string `json:"-"`
LocalPort int `json:"-"`
}

func (cfg *LocalSvrConf) LoadFromFile(name string, section ini.Section) (err error) {
Expand Down Expand Up @@ -333,10 +333,10 @@ type HttpProxyConf struct {

LocalSvrConf

Locations []string
HostHeaderRewrite string
HttpUser string
HttpPwd string
Locations []string `json:"locations"`
HostHeaderRewrite string `json:"host_header_rewrite"`
HttpUser string `json:"-"`
HttpPwd string `json:"-"`
}

func (cfg *HttpProxyConf) LoadFromMsg(pMsg *msg.NewProxy) {
Expand Down
4 changes: 3 additions & 1 deletion models/consts/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
package consts

var (
// server status
// proxy status
Idle string = "idle"
Working string = "working"
Closed string = "closed"
Online string = "online"
Offline string = "offline"

// proxy type
TcpProxy string = "tcp"
Expand Down
Loading

0 comments on commit a4fece3

Please sign in to comment.