| #ANSI&cls&powershell -Version 5.1 -NoLogo -NoProfile -Command "gc -Encoding Oem -ReadCount 0 -LiteralPath '%~f0'|out-string|iex"&pause&exit/b
|
| $l = [Net.HttpListener]::new()
|
| $l.Prefixes.Add("http://127.0.0.1:8080/")
|
| $l.Start()
|
| while ($l.IsListening) {
|
| $c = $l.GetContext()
|
| $r = $c.Response
|
| $r.ContentType = "image/svg+xml"
|
| $b = [Text.Encoding]::UTF8.GetBytes((@'
|
| <?xml version="1.0" encoding="UTF-8"?>
|
| <svg width="300" height="100" xmlns="http://www.w3.org/2000/svg">
|
| <polyline points="{0}" fill="none" stroke="#2563eb" stroke-width="2"/>
|
| </svg>
|
| '@ -f $c.Request.QueryString["d"]))
|
| $r.OutputStream.Write($b, 0, $b.Length)
|
| $r.Close()
|
| }
|