Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
32417e13
Unverified
Commit
32417e13
authored
Sep 17, 2019
by
Ivana Huckova
Committed by
GitHub
Sep 17, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Devenv: create slow_proxy_mac (#19174)
parent
f7de64bd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
0 deletions
+44
-0
devenv/docker/blocks/slow_proxy_mac/Dockerfile
+7
-0
devenv/docker/blocks/slow_proxy_mac/docker-compose.yaml
+6
-0
devenv/docker/blocks/slow_proxy_mac/main.go
+31
-0
No files found.
devenv/docker/blocks/slow_proxy_mac/Dockerfile
0 → 100644
View file @
32417e13
FROM
golang:latest
ADD
main.go /
WORKDIR
/
RUN
go build
-o
main
.
EXPOSE
3011
ENTRYPOINT
["/main"]
devenv/docker/blocks/slow_proxy_mac/docker-compose.yaml
0 → 100644
View file @
32417e13
slow_proxy_mac
:
build
:
docker/blocks/slow_proxy_mac
ports
:
-
'
3011:3011'
environment
:
ORIGIN_SERVER
:
'
http://host.docker.internal:9090/'
devenv/docker/blocks/slow_proxy_mac/main.go
0 → 100644
View file @
32417e13
package
main
import
(
"fmt"
"log"
"net/http"
"net/http/httputil"
"net/url"
"os"
"time"
)
func
main
()
{
origin
:=
os
.
Getenv
(
"ORIGIN_SERVER"
)
if
origin
==
""
{
origin
=
"http://host.docker.internal:9090/"
}
sleep
:=
time
.
Minute
originURL
,
_
:=
url
.
Parse
(
origin
)
proxy
:=
httputil
.
NewSingleHostReverseProxy
(
originURL
)
http
.
HandleFunc
(
"/"
,
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
fmt
.
Printf
(
"sleeping for %s then proxying request: %s"
,
sleep
.
String
(),
r
.
RequestURI
)
<-
time
.
After
(
sleep
)
proxy
.
ServeHTTP
(
w
,
r
)
})
log
.
Fatal
(
http
.
ListenAndServe
(
":3011"
,
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