mirror of
https://github.com/ehang-io/nps.git
synced 2025-09-02 03:16:53 +00:00
style: fmt
This commit is contained in:
@@ -6,13 +6,6 @@ import (
|
||||
"encoding/binary"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"github.com/cnlh/nps/lib/common"
|
||||
"github.com/cnlh/nps/lib/crypt"
|
||||
"github.com/cnlh/nps/lib/file"
|
||||
"github.com/cnlh/nps/lib/mux"
|
||||
"github.com/cnlh/nps/lib/pool"
|
||||
"github.com/cnlh/nps/lib/rate"
|
||||
"github.com/xtaci/kcp-go"
|
||||
"io"
|
||||
"net"
|
||||
"net/http"
|
||||
@@ -21,6 +14,14 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/cnlh/nps/lib/common"
|
||||
"github.com/cnlh/nps/lib/crypt"
|
||||
"github.com/cnlh/nps/lib/file"
|
||||
"github.com/cnlh/nps/lib/mux"
|
||||
"github.com/cnlh/nps/lib/pool"
|
||||
"github.com/cnlh/nps/lib/rate"
|
||||
"github.com/xtaci/kcp-go"
|
||||
)
|
||||
|
||||
type Conn struct {
|
||||
@@ -373,7 +374,7 @@ func CopyWaitGroup(conn1, conn2 net.Conn, crypt bool, snappy bool, rate *rate.Ra
|
||||
}
|
||||
|
||||
//get crypt or snappy conn
|
||||
func GetConn(conn net.Conn, cpt, snappy bool, rt *rate.Rate, isServer bool) (io.ReadWriteCloser) {
|
||||
func GetConn(conn net.Conn, cpt, snappy bool, rt *rate.Rate, isServer bool) io.ReadWriteCloser {
|
||||
if cpt {
|
||||
if isServer {
|
||||
return rate.NewRateConn(crypt.NewTlsServerConn(conn), rt)
|
||||
|
@@ -1,10 +1,11 @@
|
||||
package conn
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/logs"
|
||||
"github.com/xtaci/kcp-go"
|
||||
"net"
|
||||
"strings"
|
||||
|
||||
"github.com/astaxie/beego/logs"
|
||||
"github.com/xtaci/kcp-go"
|
||||
)
|
||||
|
||||
func NewTcpListenerAndProcess(addr string, f func(c net.Conn), listener *net.Listener) error {
|
||||
|
@@ -1,9 +1,10 @@
|
||||
package conn
|
||||
|
||||
import (
|
||||
"io"
|
||||
|
||||
"github.com/cnlh/nps/lib/pool"
|
||||
"github.com/golang/snappy"
|
||||
"io"
|
||||
)
|
||||
|
||||
type SnappyConn struct {
|
||||
|
Reference in New Issue
Block a user