add print version

This commit is contained in:
ffdfgdfg
2020-03-05 23:49:24 +08:00
parent f1ae3ca758
commit b6d6fedca2
4 changed files with 22 additions and 1 deletions

View File

@@ -2,9 +2,11 @@ package common
import (
"bytes"
"ehang.io/nps/lib/version"
"encoding/base64"
"encoding/binary"
"errors"
"fmt"
"html/template"
"io"
"io/ioutil"
@@ -98,7 +100,7 @@ func Getverifyval(vkey string) string {
}
//Change headers and host of request
func ChangeHostAndHeader(r *http.Request, host string, header string, addr string,addOrigin bool) {
func ChangeHostAndHeader(r *http.Request, host string, header string, addr string, addOrigin bool) {
if host != "" {
r.Host = host
}
@@ -461,3 +463,7 @@ func GetServerIpByClientIp(clientIp net.IP) string {
_, ip := GetIntranetIp()
return ip
}
func PrintVersion() {
fmt.Printf("Version: %s\nCore version: %s\nSame core version of client and server can connect each other\n", version.VERSION, version.GetVersion())
}