Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
T
tls-forward
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangmingming
tls-forward
Commits
4771cd35
Commit
4771cd35
authored
May 05, 2023
by
wangmingming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
11
parent
e8398a84
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
main.go
main.go
+3
-2
tls.go
tls/tls.go
+1
-0
No files found.
main.go
View file @
4771cd35
...
@@ -3,8 +3,8 @@ package main
...
@@ -3,8 +3,8 @@ package main
import
(
import
(
nested
"github.com/antonfisher/nested-logrus-formatter"
nested
"github.com/antonfisher/nested-logrus-formatter"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin"
"github.com/natefinch/lumberjack"
"github.com/sirupsen/logrus"
"github.com/sirupsen/logrus"
"gopkg.in/natefinch/lumberjack.v2"
"time"
"time"
"tls-forward/tls"
"tls-forward/tls"
)
)
...
@@ -44,7 +44,8 @@ func main() {
...
@@ -44,7 +44,8 @@ func main() {
Compress
:
true
,
// disabled by default
Compress
:
true
,
// disabled by default
}
}
logrus
.
SetOutput
(
logWriter
)
logrus
.
SetOutput
(
logWriter
)
//logrus.SetOutput(io.MultiWriter(logWriter, os.Stdout))
//logrus.SetOutput(os.Stdout)
r
:=
gin
.
New
()
//创建一个默认的路由引擎
r
:=
gin
.
New
()
//创建一个默认的路由引擎
r
.
Use
(
LoggerMiddleware
())
r
.
Use
(
LoggerMiddleware
())
r
.
POST
(
"/tls/forward"
,
tls
.
Forward
)
r
.
POST
(
"/tls/forward"
,
tls
.
Forward
)
...
...
tls/tls.go
View file @
4771cd35
...
@@ -26,6 +26,7 @@ func Forward(c *gin.Context) {
...
@@ -26,6 +26,7 @@ func Forward(c *gin.Context) {
})
})
return
return
}
}
logrus
.
Infof
(
"开始转发 url: %s proxy: %s"
,
forWard
.
Url
,
forWard
.
Proxy
)
t1
:=
time
.
Now
()
t1
:=
time
.
Now
()
// 开始转发
// 开始转发
client
,
err
:=
NewClient
(
forWard
)
client
,
err
:=
NewClient
(
forWard
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment