mirror of
https://github.com/ehang-io/nps.git
synced 2025-07-02 04:00:42 +00:00
change package path
This commit is contained in:
parent
18938281c2
commit
6c7ac59626
@ -1,10 +1,10 @@
|
|||||||
FROM golang as builder
|
FROM golang as builder
|
||||||
WORKDIR /go/src/github.com/cnlh/nps
|
WORKDIR /go/src/ehang.io/nps
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN go get -d -v ./...
|
RUN go get -d -v ./...
|
||||||
RUN CGO_ENABLED=0 go build -ldflags="-w -s -extldflags -static" ./cmd/npc/npc.go
|
RUN CGO_ENABLED=0 go build -ldflags="-w -s -extldflags -static" ./cmd/npc/npc.go
|
||||||
|
|
||||||
FROM scratch
|
FROM scratch
|
||||||
COPY --from=builder /go/src/github.com/cnlh/nps/npc /
|
COPY --from=builder /go/src/ehang.io/nps/npc /
|
||||||
VOLUME /conf
|
VOLUME /conf
|
||||||
ENTRYPOINT ["/npc"]
|
ENTRYPOINT ["/npc"]
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
FROM golang as builder
|
FROM golang as builder
|
||||||
WORKDIR /go/src/github.com/cnlh/nps
|
WORKDIR /go/src/ehang.io/nps
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN go get -d -v ./...
|
RUN go get -d -v ./...
|
||||||
RUN CGO_ENABLED=0 go build -ldflags="-w -s -extldflags -static" ./cmd/nps/nps.go
|
RUN CGO_ENABLED=0 go build -ldflags="-w -s -extldflags -static" ./cmd/nps/nps.go
|
||||||
|
|
||||||
FROM scratch
|
FROM scratch
|
||||||
COPY --from=builder /go/src/github.com/cnlh/nps/nps /
|
COPY --from=builder /go/src/ehang.io/nps/nps /
|
||||||
COPY --from=builder /go/src/github.com/cnlh/nps/web /web
|
COPY --from=builder /go/src/ehang.io/nps/web /web
|
||||||
VOLUME /conf
|
VOLUME /conf
|
||||||
CMD ["/nps"]
|
CMD ["/nps"]
|
||||||
|
@ -11,16 +11,16 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"ehang.io/nps/lib/common"
|
||||||
|
"ehang.io/nps/lib/conn"
|
||||||
|
"ehang.io/nps/lib/crypt"
|
||||||
|
"ehang.io/nps/lib/file"
|
||||||
|
"ehang.io/nps/lib/mux"
|
||||||
|
"ehang.io/nps/lib/version"
|
||||||
|
"ehang.io/nps/server/connection"
|
||||||
|
"ehang.io/nps/server/tool"
|
||||||
"github.com/astaxie/beego"
|
"github.com/astaxie/beego"
|
||||||
"github.com/astaxie/beego/logs"
|
"github.com/astaxie/beego/logs"
|
||||||
"github.com/cnlh/nps/lib/common"
|
|
||||||
"github.com/cnlh/nps/lib/conn"
|
|
||||||
"github.com/cnlh/nps/lib/crypt"
|
|
||||||
"github.com/cnlh/nps/lib/file"
|
|
||||||
"github.com/cnlh/nps/lib/mux"
|
|
||||||
"github.com/cnlh/nps/lib/version"
|
|
||||||
"github.com/cnlh/nps/server/connection"
|
|
||||||
"github.com/cnlh/nps/server/tool"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Client struct {
|
type Client struct {
|
||||||
|
@ -14,16 +14,16 @@ git checkout v1.2.0
|
|||||||
go install -v ./cmd/fyne
|
go install -v ./cmd/fyne
|
||||||
#fyne package -os android fyne.io/fyne/cmd/hello
|
#fyne package -os android fyne.io/fyne/cmd/hello
|
||||||
echo "fyne install success"
|
echo "fyne install success"
|
||||||
mkdir -p /go/src/github.com/cnlh/nps
|
mkdir -p /go/src/ehang.io/nps
|
||||||
cp -R /app/* /go/src/github.com/cnlh/nps
|
cp -R /app/* /go/src/ehang.io/nps
|
||||||
cd /go/src/github.com/cnlh/nps
|
cd /go/src/ehang.io/nps
|
||||||
#go get -u fyne.io/fyne fyne.io/fyne/cmd/fyne
|
#go get -u fyne.io/fyne fyne.io/fyne/cmd/fyne
|
||||||
rm cmd/npc/sdk.go
|
rm cmd/npc/sdk.go
|
||||||
#go get -u ./...
|
#go get -u ./...
|
||||||
#go mod tidy
|
#go mod tidy
|
||||||
#rm -rf /go/src/golang.org/x/mobile
|
#rm -rf /go/src/golang.org/x/mobile
|
||||||
echo "tidy success"
|
echo "tidy success"
|
||||||
cd /go/src/github.com/cnlh/nps
|
cd /go/src/ehang.io/nps
|
||||||
go mod vendor
|
go mod vendor
|
||||||
cd vendor
|
cd vendor
|
||||||
cp -R * /go/src
|
cp -R * /go/src
|
||||||
|
@ -11,11 +11,11 @@ import (
|
|||||||
"github.com/astaxie/beego/logs"
|
"github.com/astaxie/beego/logs"
|
||||||
"github.com/xtaci/kcp-go"
|
"github.com/xtaci/kcp-go"
|
||||||
|
|
||||||
"github.com/cnlh/nps/lib/common"
|
"ehang.io/nps/lib/common"
|
||||||
"github.com/cnlh/nps/lib/config"
|
"ehang.io/nps/lib/config"
|
||||||
"github.com/cnlh/nps/lib/conn"
|
"ehang.io/nps/lib/conn"
|
||||||
"github.com/cnlh/nps/lib/crypt"
|
"ehang.io/nps/lib/crypt"
|
||||||
"github.com/cnlh/nps/lib/mux"
|
"ehang.io/nps/lib/mux"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TRPClient struct {
|
type TRPClient struct {
|
||||||
@ -44,6 +44,7 @@ func NewRPClient(svraddr string, vKey string, bridgeConnType string, proxyUrl st
|
|||||||
|
|
||||||
var NowStatus int
|
var NowStatus int
|
||||||
var CloseClient bool
|
var CloseClient bool
|
||||||
|
|
||||||
//start
|
//start
|
||||||
func (s *TRPClient) Start() {
|
func (s *TRPClient) Start() {
|
||||||
CloseClient = false
|
CloseClient = false
|
||||||
|
@ -19,12 +19,12 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"ehang.io/nps/lib/common"
|
||||||
|
"ehang.io/nps/lib/config"
|
||||||
|
"ehang.io/nps/lib/conn"
|
||||||
|
"ehang.io/nps/lib/crypt"
|
||||||
|
"ehang.io/nps/lib/version"
|
||||||
"github.com/astaxie/beego/logs"
|
"github.com/astaxie/beego/logs"
|
||||||
"github.com/cnlh/nps/lib/common"
|
|
||||||
"github.com/cnlh/nps/lib/config"
|
|
||||||
"github.com/cnlh/nps/lib/conn"
|
|
||||||
"github.com/cnlh/nps/lib/crypt"
|
|
||||||
"github.com/cnlh/nps/lib/version"
|
|
||||||
"github.com/xtaci/kcp-go"
|
"github.com/xtaci/kcp-go"
|
||||||
"golang.org/x/net/proxy"
|
"golang.org/x/net/proxy"
|
||||||
)
|
)
|
||||||
|
@ -7,10 +7,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"ehang.io/nps/lib/conn"
|
||||||
|
"ehang.io/nps/lib/file"
|
||||||
|
"ehang.io/nps/lib/sheap"
|
||||||
"github.com/astaxie/beego/logs"
|
"github.com/astaxie/beego/logs"
|
||||||
"github.com/cnlh/nps/lib/conn"
|
|
||||||
"github.com/cnlh/nps/lib/file"
|
|
||||||
"github.com/cnlh/nps/lib/sheap"
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"ehang.io/nps/lib/common"
|
||||||
|
"ehang.io/nps/lib/config"
|
||||||
|
"ehang.io/nps/lib/conn"
|
||||||
|
"ehang.io/nps/lib/crypt"
|
||||||
|
"ehang.io/nps/lib/file"
|
||||||
|
"ehang.io/nps/lib/mux"
|
||||||
|
"ehang.io/nps/server/proxy"
|
||||||
"github.com/astaxie/beego/logs"
|
"github.com/astaxie/beego/logs"
|
||||||
"github.com/cnlh/nps/lib/common"
|
|
||||||
"github.com/cnlh/nps/lib/config"
|
|
||||||
"github.com/cnlh/nps/lib/conn"
|
|
||||||
"github.com/cnlh/nps/lib/crypt"
|
|
||||||
"github.com/cnlh/nps/lib/file"
|
|
||||||
"github.com/cnlh/nps/lib/mux"
|
|
||||||
"github.com/cnlh/nps/server/proxy"
|
|
||||||
"github.com/xtaci/kcp-go"
|
"github.com/xtaci/kcp-go"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/cnlh/nps/lib/common"
|
"ehang.io/nps/lib/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
func RegisterLocalIp(server string, vKey string, tp string, proxyUrl string, hour int) {
|
func RegisterLocalIp(server string, vKey string, tp string, proxyUrl string, hour int) {
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"ehang.io/nps/client"
|
||||||
|
"ehang.io/nps/lib/common"
|
||||||
|
"ehang.io/nps/lib/config"
|
||||||
|
"ehang.io/nps/lib/file"
|
||||||
|
"ehang.io/nps/lib/install"
|
||||||
|
"ehang.io/nps/lib/version"
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/astaxie/beego/logs"
|
"github.com/astaxie/beego/logs"
|
||||||
"github.com/ccding/go-stun/stun"
|
"github.com/ccding/go-stun/stun"
|
||||||
"github.com/cnlh/nps/client"
|
|
||||||
"github.com/cnlh/nps/lib/common"
|
|
||||||
"github.com/cnlh/nps/lib/config"
|
|
||||||
"github.com/cnlh/nps/lib/file"
|
|
||||||
"github.com/cnlh/nps/lib/install"
|
|
||||||
"github.com/cnlh/nps/lib/version"
|
|
||||||
"github.com/kardianos/service"
|
"github.com/kardianos/service"
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
@ -2,10 +2,10 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"C"
|
"C"
|
||||||
|
"ehang.io/nps/client"
|
||||||
|
"ehang.io/nps/lib/common"
|
||||||
|
"ehang.io/nps/lib/version"
|
||||||
"github.com/astaxie/beego/logs"
|
"github.com/astaxie/beego/logs"
|
||||||
"github.com/cnlh/nps/client"
|
|
||||||
"github.com/cnlh/nps/lib/common"
|
|
||||||
"github.com/cnlh/nps/lib/version"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var cl *client.TRPClient
|
var cl *client.TRPClient
|
||||||
|
@ -1,26 +1,26 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"ehang.io/nps/lib/install"
|
||||||
"flag"
|
"flag"
|
||||||
"github.com/cnlh/nps/lib/install"
|
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"ehang.io/nps/lib/common"
|
||||||
|
"ehang.io/nps/lib/crypt"
|
||||||
|
"ehang.io/nps/lib/daemon"
|
||||||
|
"ehang.io/nps/lib/file"
|
||||||
|
"ehang.io/nps/lib/version"
|
||||||
|
"ehang.io/nps/server"
|
||||||
|
"ehang.io/nps/server/connection"
|
||||||
|
"ehang.io/nps/server/tool"
|
||||||
"github.com/astaxie/beego"
|
"github.com/astaxie/beego"
|
||||||
"github.com/astaxie/beego/logs"
|
"github.com/astaxie/beego/logs"
|
||||||
"github.com/cnlh/nps/lib/common"
|
|
||||||
"github.com/cnlh/nps/lib/crypt"
|
|
||||||
"github.com/cnlh/nps/lib/daemon"
|
|
||||||
"github.com/cnlh/nps/lib/file"
|
|
||||||
"github.com/cnlh/nps/lib/version"
|
|
||||||
"github.com/cnlh/nps/server"
|
|
||||||
"github.com/cnlh/nps/server/connection"
|
|
||||||
"github.com/cnlh/nps/server/tool"
|
|
||||||
|
|
||||||
"github.com/cnlh/nps/web/routers"
|
"ehang.io/nps/web/routers"
|
||||||
"github.com/kardianos/service"
|
"github.com/kardianos/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"ehang.io/nps/client"
|
||||||
|
"ehang.io/nps/lib/common"
|
||||||
|
"ehang.io/nps/lib/daemon"
|
||||||
|
"ehang.io/nps/lib/version"
|
||||||
"fmt"
|
"fmt"
|
||||||
"fyne.io/fyne"
|
"fyne.io/fyne"
|
||||||
"fyne.io/fyne/app"
|
"fyne.io/fyne/app"
|
||||||
"fyne.io/fyne/layout"
|
"fyne.io/fyne/layout"
|
||||||
"fyne.io/fyne/widget"
|
"fyne.io/fyne/widget"
|
||||||
"github.com/astaxie/beego/logs"
|
"github.com/astaxie/beego/logs"
|
||||||
"github.com/cnlh/nps/client"
|
|
||||||
"github.com/cnlh/nps/lib/common"
|
|
||||||
"github.com/cnlh/nps/lib/daemon"
|
|
||||||
"github.com/cnlh/nps/lib/version"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
@ -16,7 +16,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/cnlh/nps/lib/crypt"
|
"ehang.io/nps/lib/crypt"
|
||||||
)
|
)
|
||||||
|
|
||||||
//Get the corresponding IP address through domain name
|
//Get the corresponding IP address through domain name
|
||||||
|
@ -6,8 +6,8 @@ import (
|
|||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/cnlh/nps/lib/common"
|
"ehang.io/nps/lib/common"
|
||||||
"github.com/cnlh/nps/lib/file"
|
"ehang.io/nps/lib/file"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CommonConfig struct {
|
type CommonConfig struct {
|
||||||
@ -241,7 +241,7 @@ func dealTunnel(s string) *file.Tunnel {
|
|||||||
t.StripPre = item[1]
|
t.StripPre = item[1]
|
||||||
case "multi_account":
|
case "multi_account":
|
||||||
t.MultiAccount = &file.MultiAccount{}
|
t.MultiAccount = &file.MultiAccount{}
|
||||||
if common.FileExists(item[1]){
|
if common.FileExists(item[1]) {
|
||||||
if b, err := common.ReadAllFromFile(item[1]); err != nil {
|
if b, err := common.ReadAllFromFile(item[1]); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
} else {
|
} else {
|
||||||
|
@ -3,11 +3,11 @@ package conn
|
|||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"ehang.io/nps/lib/goroutine"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"github.com/astaxie/beego/logs"
|
"github.com/astaxie/beego/logs"
|
||||||
"github.com/cnlh/nps/lib/goroutine"
|
|
||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
@ -16,11 +16,11 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/cnlh/nps/lib/common"
|
"ehang.io/nps/lib/common"
|
||||||
"github.com/cnlh/nps/lib/crypt"
|
"ehang.io/nps/lib/crypt"
|
||||||
"github.com/cnlh/nps/lib/file"
|
"ehang.io/nps/lib/file"
|
||||||
"github.com/cnlh/nps/lib/mux"
|
"ehang.io/nps/lib/mux"
|
||||||
"github.com/cnlh/nps/lib/rate"
|
"ehang.io/nps/lib/rate"
|
||||||
"github.com/xtaci/kcp-go"
|
"github.com/xtaci/kcp-go"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/cnlh/nps/lib/common"
|
"ehang.io/nps/lib/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
func InitDaemon(f string, runPath string, pidPath string) {
|
func InitDaemon(f string, runPath string, pidPath string) {
|
||||||
|
@ -8,8 +8,8 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
|
"ehang.io/nps/lib/common"
|
||||||
"github.com/astaxie/beego"
|
"github.com/astaxie/beego"
|
||||||
"github.com/cnlh/nps/lib/common"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -9,9 +9,9 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/cnlh/nps/lib/common"
|
"ehang.io/nps/lib/common"
|
||||||
"github.com/cnlh/nps/lib/crypt"
|
"ehang.io/nps/lib/crypt"
|
||||||
"github.com/cnlh/nps/lib/rate"
|
"ehang.io/nps/lib/rate"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DbUtils struct {
|
type DbUtils struct {
|
||||||
|
@ -9,8 +9,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
|
|
||||||
"github.com/cnlh/nps/lib/common"
|
"ehang.io/nps/lib/common"
|
||||||
"github.com/cnlh/nps/lib/rate"
|
"ehang.io/nps/lib/rate"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewJsonDb(runPath string) *JsonDb {
|
func NewJsonDb(runPath string) *JsonDb {
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/cnlh/nps/lib/rate"
|
"ehang.io/nps/lib/rate"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package goroutine
|
package goroutine
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/cnlh/nps/lib/common"
|
"ehang.io/nps/lib/common"
|
||||||
"github.com/cnlh/nps/lib/file"
|
"ehang.io/nps/lib/file"
|
||||||
"github.com/panjf2000/ants/v2"
|
"github.com/panjf2000/ants/v2"
|
||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package install
|
package install
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"ehang.io/nps/lib/common"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/c4milo/unpackit"
|
"github.com/c4milo/unpackit"
|
||||||
"github.com/cnlh/nps/lib/common"
|
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
@ -50,7 +50,7 @@ func downloadLatest(bin string) string {
|
|||||||
fmt.Println("the latest version is", version)
|
fmt.Println("the latest version is", version)
|
||||||
filename := runtime.GOOS + "_" + runtime.GOARCH + "_" + bin + ".tar.gz"
|
filename := runtime.GOOS + "_" + runtime.GOARCH + "_" + bin + ".tar.gz"
|
||||||
// download latest package
|
// download latest package
|
||||||
downloadUrl := fmt.Sprintf("https://github.com/cnlh/nps/releases/download/%s/%s", version, filename)
|
downloadUrl := fmt.Sprintf("https://ehang.io/nps/releases/download/%s/%s", version, filename)
|
||||||
fmt.Println("download package from ", downloadUrl)
|
fmt.Println("download package from ", downloadUrl)
|
||||||
resp, err := http.Get(downloadUrl)
|
resp, err := http.Get(downloadUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package mux
|
package mux
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"ehang.io/nps/lib/common"
|
||||||
"errors"
|
"errors"
|
||||||
"github.com/astaxie/beego/logs"
|
"github.com/astaxie/beego/logs"
|
||||||
"github.com/cnlh/nps/lib/common"
|
|
||||||
"io"
|
"io"
|
||||||
"math"
|
"math"
|
||||||
"net"
|
"net"
|
||||||
|
@ -9,8 +9,8 @@ import (
|
|||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"ehang.io/nps/lib/common"
|
||||||
"github.com/astaxie/beego/logs"
|
"github.com/astaxie/beego/logs"
|
||||||
"github.com/cnlh/nps/lib/common"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Mux struct {
|
type Mux struct {
|
||||||
|
@ -2,9 +2,9 @@ package mux
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
|
"ehang.io/nps/lib/common"
|
||||||
|
"ehang.io/nps/lib/goroutine"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/cnlh/nps/lib/common"
|
|
||||||
"github.com/cnlh/nps/lib/goroutine"
|
|
||||||
"io"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
|
@ -12,8 +12,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"ehang.io/nps/lib/common"
|
||||||
"github.com/astaxie/beego/logs"
|
"github.com/astaxie/beego/logs"
|
||||||
"github.com/cnlh/nps/lib/common"
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package mux
|
package mux
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"ehang.io/nps/lib/common"
|
||||||
"errors"
|
"errors"
|
||||||
"github.com/cnlh/nps/lib/common"
|
|
||||||
"io"
|
"io"
|
||||||
"math"
|
"math"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
@ -5,9 +5,9 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"ehang.io/nps/lib/mux"
|
||||||
"github.com/astaxie/beego"
|
"github.com/astaxie/beego"
|
||||||
"github.com/astaxie/beego/logs"
|
"github.com/astaxie/beego/logs"
|
||||||
"github.com/cnlh/nps/lib/mux"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var pMux *mux.PortMux
|
var pMux *mux.PortMux
|
||||||
|
@ -6,11 +6,11 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
"ehang.io/nps/bridge"
|
||||||
|
"ehang.io/nps/lib/common"
|
||||||
|
"ehang.io/nps/lib/conn"
|
||||||
|
"ehang.io/nps/lib/file"
|
||||||
"github.com/astaxie/beego/logs"
|
"github.com/astaxie/beego/logs"
|
||||||
"github.com/cnlh/nps/bridge"
|
|
||||||
"github.com/cnlh/nps/lib/common"
|
|
||||||
"github.com/cnlh/nps/lib/conn"
|
|
||||||
"github.com/cnlh/nps/lib/file"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Service interface {
|
type Service interface {
|
||||||
|
@ -13,13 +13,13 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
"ehang.io/nps/bridge"
|
||||||
|
"ehang.io/nps/lib/cache"
|
||||||
|
"ehang.io/nps/lib/common"
|
||||||
|
"ehang.io/nps/lib/conn"
|
||||||
|
"ehang.io/nps/lib/file"
|
||||||
|
"ehang.io/nps/server/connection"
|
||||||
"github.com/astaxie/beego/logs"
|
"github.com/astaxie/beego/logs"
|
||||||
"github.com/cnlh/nps/bridge"
|
|
||||||
"github.com/cnlh/nps/lib/cache"
|
|
||||||
"github.com/cnlh/nps/lib/common"
|
|
||||||
"github.com/cnlh/nps/lib/conn"
|
|
||||||
"github.com/cnlh/nps/lib/file"
|
|
||||||
"github.com/cnlh/nps/server/connection"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type httpServer struct {
|
type httpServer struct {
|
||||||
|
@ -6,13 +6,13 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
"ehang.io/nps/lib/cache"
|
||||||
|
"ehang.io/nps/lib/common"
|
||||||
|
"ehang.io/nps/lib/conn"
|
||||||
|
"ehang.io/nps/lib/crypt"
|
||||||
|
"ehang.io/nps/lib/file"
|
||||||
"github.com/astaxie/beego"
|
"github.com/astaxie/beego"
|
||||||
"github.com/astaxie/beego/logs"
|
"github.com/astaxie/beego/logs"
|
||||||
"github.com/cnlh/nps/lib/cache"
|
|
||||||
"github.com/cnlh/nps/lib/common"
|
|
||||||
"github.com/cnlh/nps/lib/conn"
|
|
||||||
"github.com/cnlh/nps/lib/crypt"
|
|
||||||
"github.com/cnlh/nps/lib/file"
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -5,8 +5,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"ehang.io/nps/lib/common"
|
||||||
"github.com/astaxie/beego/logs"
|
"github.com/astaxie/beego/logs"
|
||||||
"github.com/cnlh/nps/lib/common"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type P2PServer struct {
|
type P2PServer struct {
|
||||||
|
@ -7,10 +7,10 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"ehang.io/nps/lib/common"
|
||||||
|
"ehang.io/nps/lib/conn"
|
||||||
|
"ehang.io/nps/lib/file"
|
||||||
"github.com/astaxie/beego/logs"
|
"github.com/astaxie/beego/logs"
|
||||||
"github.com/cnlh/nps/lib/common"
|
|
||||||
"github.com/cnlh/nps/lib/conn"
|
|
||||||
"github.com/cnlh/nps/lib/file"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -7,13 +7,13 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"ehang.io/nps/bridge"
|
||||||
|
"ehang.io/nps/lib/common"
|
||||||
|
"ehang.io/nps/lib/conn"
|
||||||
|
"ehang.io/nps/lib/file"
|
||||||
|
"ehang.io/nps/server/connection"
|
||||||
"github.com/astaxie/beego"
|
"github.com/astaxie/beego"
|
||||||
"github.com/astaxie/beego/logs"
|
"github.com/astaxie/beego/logs"
|
||||||
"github.com/cnlh/nps/bridge"
|
|
||||||
"github.com/cnlh/nps/lib/common"
|
|
||||||
"github.com/cnlh/nps/lib/conn"
|
|
||||||
"github.com/cnlh/nps/lib/file"
|
|
||||||
"github.com/cnlh/nps/server/connection"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type TunnelModeServer struct {
|
type TunnelModeServer struct {
|
||||||
|
@ -7,8 +7,8 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"github.com/cnlh/nps/lib/common"
|
"ehang.io/nps/lib/common"
|
||||||
"github.com/cnlh/nps/lib/conn"
|
"ehang.io/nps/lib/conn"
|
||||||
)
|
)
|
||||||
|
|
||||||
func HandleTrans(c *conn.Conn, s *TunnelModeServer) error {
|
func HandleTrans(c *conn.Conn, s *TunnelModeServer) error {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
package proxy
|
package proxy
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/cnlh/nps/lib/conn"
|
"ehang.io/nps/lib/conn"
|
||||||
)
|
)
|
||||||
|
|
||||||
func HandleTrans(c *conn.Conn, s *TunnelModeServer) error {
|
func HandleTrans(c *conn.Conn, s *TunnelModeServer) error {
|
||||||
|
@ -4,11 +4,11 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"ehang.io/nps/bridge"
|
||||||
|
"ehang.io/nps/lib/common"
|
||||||
|
"ehang.io/nps/lib/conn"
|
||||||
|
"ehang.io/nps/lib/file"
|
||||||
"github.com/astaxie/beego/logs"
|
"github.com/astaxie/beego/logs"
|
||||||
"github.com/cnlh/nps/bridge"
|
|
||||||
"github.com/cnlh/nps/lib/common"
|
|
||||||
"github.com/cnlh/nps/lib/conn"
|
|
||||||
"github.com/cnlh/nps/lib/file"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type UdpModeServer struct {
|
type UdpModeServer struct {
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"ehang.io/nps/lib/version"
|
||||||
"errors"
|
"errors"
|
||||||
"github.com/cnlh/nps/lib/version"
|
|
||||||
"math"
|
"math"
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"ehang.io/nps/bridge"
|
||||||
|
"ehang.io/nps/lib/common"
|
||||||
|
"ehang.io/nps/lib/file"
|
||||||
|
"ehang.io/nps/server/proxy"
|
||||||
|
"ehang.io/nps/server/tool"
|
||||||
"github.com/astaxie/beego"
|
"github.com/astaxie/beego"
|
||||||
"github.com/astaxie/beego/logs"
|
"github.com/astaxie/beego/logs"
|
||||||
"github.com/cnlh/nps/bridge"
|
|
||||||
"github.com/cnlh/nps/lib/common"
|
|
||||||
"github.com/cnlh/nps/lib/file"
|
|
||||||
"github.com/cnlh/nps/server/proxy"
|
|
||||||
"github.com/cnlh/nps/server/tool"
|
|
||||||
"github.com/shirou/gopsutil/cpu"
|
"github.com/shirou/gopsutil/cpu"
|
||||||
"github.com/shirou/gopsutil/load"
|
"github.com/shirou/gopsutil/load"
|
||||||
"github.com/shirou/gopsutil/mem"
|
"github.com/shirou/gopsutil/mem"
|
||||||
|
@ -5,9 +5,9 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"ehang.io/nps/lib/common"
|
||||||
|
"ehang.io/nps/lib/file"
|
||||||
"github.com/astaxie/beego"
|
"github.com/astaxie/beego"
|
||||||
"github.com/cnlh/nps/lib/common"
|
|
||||||
"github.com/cnlh/nps/lib/file"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestServerConfig() {
|
func TestServerConfig() {
|
||||||
|
@ -5,8 +5,8 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"ehang.io/nps/lib/common"
|
||||||
"github.com/astaxie/beego"
|
"github.com/astaxie/beego"
|
||||||
"github.com/cnlh/nps/lib/common"
|
|
||||||
"github.com/shirou/gopsutil/cpu"
|
"github.com/shirou/gopsutil/cpu"
|
||||||
"github.com/shirou/gopsutil/load"
|
"github.com/shirou/gopsutil/load"
|
||||||
"github.com/shirou/gopsutil/mem"
|
"github.com/shirou/gopsutil/mem"
|
||||||
|
@ -4,8 +4,8 @@ import (
|
|||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"ehang.io/nps/lib/crypt"
|
||||||
"github.com/astaxie/beego"
|
"github.com/astaxie/beego"
|
||||||
"github.com/cnlh/nps/lib/crypt"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type AuthController struct {
|
type AuthController struct {
|
||||||
|
@ -7,11 +7,11 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"ehang.io/nps/lib/common"
|
||||||
|
"ehang.io/nps/lib/crypt"
|
||||||
|
"ehang.io/nps/lib/file"
|
||||||
|
"ehang.io/nps/server"
|
||||||
"github.com/astaxie/beego"
|
"github.com/astaxie/beego"
|
||||||
"github.com/cnlh/nps/lib/common"
|
|
||||||
"github.com/cnlh/nps/lib/crypt"
|
|
||||||
"github.com/cnlh/nps/lib/file"
|
|
||||||
"github.com/cnlh/nps/server"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type BaseController struct {
|
type BaseController struct {
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package controllers
|
package controllers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"ehang.io/nps/lib/common"
|
||||||
|
"ehang.io/nps/lib/file"
|
||||||
|
"ehang.io/nps/lib/rate"
|
||||||
|
"ehang.io/nps/server"
|
||||||
"github.com/astaxie/beego"
|
"github.com/astaxie/beego"
|
||||||
"github.com/cnlh/nps/lib/common"
|
|
||||||
"github.com/cnlh/nps/lib/file"
|
|
||||||
"github.com/cnlh/nps/lib/rate"
|
|
||||||
"github.com/cnlh/nps/server"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type ClientController struct {
|
type ClientController struct {
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package controllers
|
package controllers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/cnlh/nps/lib/file"
|
"ehang.io/nps/lib/file"
|
||||||
"github.com/cnlh/nps/server"
|
"ehang.io/nps/server"
|
||||||
"github.com/cnlh/nps/server/tool"
|
"ehang.io/nps/server/tool"
|
||||||
|
|
||||||
"github.com/astaxie/beego"
|
"github.com/astaxie/beego"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -6,10 +6,10 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"ehang.io/nps/lib/common"
|
||||||
|
"ehang.io/nps/lib/file"
|
||||||
|
"ehang.io/nps/server"
|
||||||
"github.com/astaxie/beego"
|
"github.com/astaxie/beego"
|
||||||
"github.com/cnlh/nps/lib/common"
|
|
||||||
"github.com/cnlh/nps/lib/file"
|
|
||||||
"github.com/cnlh/nps/server"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type LoginController struct {
|
type LoginController struct {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package routers
|
package routers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"ehang.io/nps/web/controllers"
|
||||||
"github.com/astaxie/beego"
|
"github.com/astaxie/beego"
|
||||||
"github.com/cnlh/nps/web/controllers"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func Init() {
|
func Init() {
|
||||||
|
@ -5,6 +5,6 @@
|
|||||||
<title>nps error</title>
|
<title>nps error</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
404 not found,power by <a href="//github.com/cnlh/nps">nps</a>
|
404 not found,power by <a href="//ehang.io/nps">nps</a>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -37,7 +37,7 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
goto <a href="//github.com/cnlh/nps">nps</a>
|
goto <a href="//ehang.io/nps">nps</a>
|
||||||
</p>
|
</p>
|
||||||
<div class="ibox-content">
|
<div class="ibox-content">
|
||||||
<form class="m-t" onsubmit="return false">
|
<form class="m-t" onsubmit="return false">
|
||||||
|
@ -105,7 +105,7 @@
|
|||||||
<ul class="nav navbar-top-links navbar-right">
|
<ul class="nav navbar-top-links navbar-right">
|
||||||
<li>
|
<li>
|
||||||
<span class="m-r-sm text-muted welcome-message">Welcome to use <a
|
<span class="m-r-sm text-muted welcome-message">Welcome to use <a
|
||||||
href="https://github.com/cnlh/nps">NPS</a></span>
|
href="https://ehang.io/nps">NPS</a></span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a id="lang-en">English</a>
|
<a id="lang-en">English</a>
|
||||||
@ -128,7 +128,7 @@
|
|||||||
{{.LayoutContent}}
|
{{.LayoutContent}}
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
read more <strong><a href="https://github.com/cnlh/nps">go</a></strong>
|
read more <strong><a href="https://ehang.io/nps">go</a></strong>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<strong>Copyright</strong> nps © 2018-2019
|
<strong>Copyright</strong> nps © 2018-2019
|
||||||
|
Loading…
x
Reference in New Issue
Block a user