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
aca59d1b
Commit
aca59d1b
authored
Oct 24, 2019
by
gaoshiyao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新路由设置
parent
e3d44b8b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
2 deletions
+1
-2
src/handler/proxyhandler.go
src/handler/proxyhandler.go
+0
-2
src/main.go
src/main.go
+1
-0
No files found.
src/handler/proxyhandler.go
View file @
aca59d1b
...
@@ -2,7 +2,6 @@ package handler
...
@@ -2,7 +2,6 @@ package handler
import
(
import
(
"fmt"
"fmt"
"github.com/sirupsen/logrus"
"net/http"
"net/http"
"strings"
"strings"
...
@@ -30,7 +29,6 @@ func CreateProxyHandler() (*ProxyHandler, error) {
...
@@ -30,7 +29,6 @@ func CreateProxyHandler() (*ProxyHandler, error) {
var
ch
chan
bool
var
ch
chan
bool
func
(
handler
*
ProxyHandler
)
ServeHTTP
(
w
http
.
ResponseWriter
,
req
*
http
.
Request
)
{
func
(
handler
*
ProxyHandler
)
ServeHTTP
(
w
http
.
ResponseWriter
,
req
*
http
.
Request
)
{
logrus
.
Info
(
"===>"
,
req
.
URL
)
if
err
:=
count
();
err
!=
nil
{
if
err
:=
count
();
err
!=
nil
{
fmt
.
Println
(
err
.
Error
())
fmt
.
Println
(
err
.
Error
())
w
.
Write
([]
byte
(
"缓存计数失败!"
))
w
.
Write
([]
byte
(
"缓存计数失败!"
))
...
...
src/main.go
View file @
aca59d1b
...
@@ -27,6 +27,7 @@ func main() {
...
@@ -27,6 +27,7 @@ func main() {
counthandler
,
_
:=
handler
.
CreateCountHandler
()
counthandler
,
_
:=
handler
.
CreateCountHandler
()
http
.
Handle
(
fmt
.
Sprintf
(
"%s%s"
,
*
argPrefix
,
"/count"
),
counthandler
)
http
.
Handle
(
fmt
.
Sprintf
(
"%s%s"
,
*
argPrefix
,
"/count"
),
counthandler
)
http
.
Handle
(
*
argPrefix
+
"/"
,
proxyhandler
)
http
.
Handle
(
*
argPrefix
+
"/"
,
proxyhandler
)
http
.
Handle
(
os
.
Getenv
(
"PROXY_PATH"
)
+
"/"
,
proxyhandler
)
logrus
.
Info
(
"Listen Server on port :"
,
*
argPort
)
logrus
.
Info
(
"Listen Server on port :"
,
*
argPort
)
http
.
ListenAndServe
(
fmt
.
Sprintf
(
":%d"
,
*
argPort
),
nil
)
http
.
ListenAndServe
(
fmt
.
Sprintf
(
":%d"
,
*
argPort
),
nil
)
}
}
...
...
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