Skip to content

notsobad/ynm3k

Repository files navigation

YNM3K

A Fakesite for http test, see also go-fakesite.

docker run -p 9527:80 notsobad/ynm3k

curl http://127.0.0.1:9527/

Also you can build it yourself

cd ynm3k
docker build -t ynm3k .
docker run -it --rm -p 9527:80 ynm3k

A demo page with http 502 response:

wangxh:~/myapp/ynm3k$ curl 127.1:9527/code/502.jpg -vv
> GET /code/502.jpg HTTP/1.1
> User-Agent: curl/7.30.0
> Host: 127.1:9527
> Accept: */*
>
< HTTP/1.1 502 Bad Gateway
< Content-Length: 62
< Set-Cookie: csrftoken=8e0f2f299fede170969578ebceec0967; expires=Thu, 09-Jan-2014 06:29:39 GMT; Max-Age=31449600; Path=/
< Vary: Accept-Encoding
< Server: YNM3000
< Date: Wed, 14 May 2014 09:25:11 GMT
< Content-Type: text/html; charset=UTF-8
<
<h1>Http 502</h1> <hr/>Generated at 2014-05-14 17:25:11.603423

Trace

Show raw request header.

/trace/

Static file

Visit same url, get same result

/static/$RANDOM.$EXT

Dynamic url

Visit same url, get different result

/dynamic/$RANDOM.$EXT

HTTP status code

/code/$CODE.$EXT

Specified size response

You can output a file of the specified size.

/size/$SIZE.$EXT

A server with a slow response

Visit /slow/$SECONDS, the url will take $SECONDS time to render.

URL redirect

All kinds of url redirect method

DEMO:

curl -v 'localhost:9527/redirect/301?url=file:///etc/passwd'
curl -v 'localhost:9527/redirect/302?url=http://www.jiasule.com'