Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
apaas-meshproxy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gzga-jzapi
apaas-meshproxy
Commits
0e4f6c6d
Commit
0e4f6c6d
authored
Oct 22, 2019
by
gaoshiyao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
计数过滤
parent
194c7797
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
src/handler/proxyhandler.go
src/handler/proxyhandler.go
+4
-1
No files found.
src/handler/proxyhandler.go
View file @
0e4f6c6d
...
@@ -21,9 +21,12 @@ func CreateProxyHandler() (*ProxyHandler, error) {
...
@@ -21,9 +21,12 @@ func CreateProxyHandler() (*ProxyHandler, error) {
handler
:=
new
(
ProxyHandler
)
handler
:=
new
(
ProxyHandler
)
fwd
,
_
:=
forward
.
New
(
forward
.
PassHostHeader
(
true
))
fwd
,
_
:=
forward
.
New
(
forward
.
PassHostHeader
(
true
))
handler
.
forward
=
fwd
handler
.
forward
=
fwd
ch
=
make
(
chan
bool
,
1
)
return
handler
,
nil
return
handler
,
nil
}
}
var
ch
chan
bool
func
(
handler
*
ProxyHandler
)
ServeHTTP
(
w
http
.
ResponseWriter
,
req
*
http
.
Request
)
{
func
(
handler
*
ProxyHandler
)
ServeHTTP
(
w
http
.
ResponseWriter
,
req
*
http
.
Request
)
{
if
err
:=
count
();
err
!=
nil
{
if
err
:=
count
();
err
!=
nil
{
fmt
.
Println
(
err
.
Error
())
fmt
.
Println
(
err
.
Error
())
...
@@ -75,6 +78,6 @@ func count() error {
...
@@ -75,6 +78,6 @@ func count() error {
return
err
return
err
}
}
ic
,
err
:=
redis
.
Incr
(
fmt
.
Sprintf
(
"%s%s"
,
config
.
ProxyHost
,
config
.
ProxyPath
))
ic
,
err
:=
redis
.
Incr
(
fmt
.
Sprintf
(
"%s%s"
,
config
.
ProxyHost
,
config
.
ProxyPath
))
fmt
.
Println
(
ic
)
_
,
err
=
ic
.
Result
(
)
return
err
return
err
}
}
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