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
70c5f4f2
Commit
70c5f4f2
authored
Nov 07, 2019
by
gaoshiyao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新路由设置
parent
f77c3f1b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
14 deletions
+5
-14
docs/proxy.yaml
docs/proxy.yaml
+1
-1
src/handler/proxyhandler.go
src/handler/proxyhandler.go
+0
-12
src/main.go
src/main.go
+3
-0
src/router/router.go
src/router/router.go
+1
-1
No files found.
docs/proxy.yaml
View file @
70c5f4f2
{
"
uui
d"
:
"
sdfasd"
,
"
meshI
d"
:
"
sdfasd"
,
"
url"
:
"
https://apaas.wodcloud.com/cigservice/baseservice/fillder/turnover?applyId=0419f3e1-8e16-4e5e-a187-1760364c04e2"
,
"
method"
:
"
GET"
,
"
params"
:
null
...
...
src/handler/proxyhandler.go
View file @
70c5f4f2
...
...
@@ -34,19 +34,7 @@ func Proxy(c *gin.Context) {
c
.
Error
(
err
)
return
}
c
.
Writer
.
Write
(
result
)
//
//req := c.Request
//baseUrl := "http://" + req.Host + req.URL.Path
//req.URL = testutils.ParseURI(getProxyURL(req))
//req.RequestURI = getRequestURI(req)
//req.Host = req.URL.Host
//logrus.Info("************************************")
//logrus.Info("* 调用地址:", baseUrl)
//logrus.Info("* 转发地址:", req.URL)
//logrus.Info("************************************")
//fwd.ServeHTTP(c.Writer, req)
}
func
getProxyURL
(
req
*
http
.
Request
)
string
{
...
...
src/main.go
View file @
70c5f4f2
...
...
@@ -66,4 +66,7 @@ func getProxyConf() {
}
json
.
Unmarshal
(
b
,
&
config
.
ProxyConf
)
fmt
.
Println
(
"代理参数:"
,
config
.
ProxyConf
)
if
len
(
config
.
ProxyConf
.
MeshId
)
>
0
{
*
argPrefix
+=
"/"
+
config
.
ProxyConf
.
MeshId
}
}
src/router/router.go
View file @
70c5f4f2
...
...
@@ -32,7 +32,7 @@ func Load(middleware ...gin.HandlerFunc) http.Handler {
root
:=
e
.
Group
(
config
.
Prefix
)
{
root
.
GET
(
"/count"
,
handler
.
GetCount
)
root
.
Any
(
"/proxy
/*action
"
,
handler
.
Proxy
)
root
.
Any
(
"/proxy"
,
handler
.
Proxy
)
}
return
e
...
...
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