<div dir="ltr">Maybe this one:<div><br></div><div><div>import vibe.d;</div><div>import std.regex;</div><div>import std.array : appender;</div><div><br></div><div>static reg = ctRegex!"^/greeting/([a-z]+)$";</div><div><br></div><div>void main()</div><div>{</div><div>    setupWorkerThreads(logicalProcessorCount);</div><div>    runWorkerTaskDist(&runServer);</div><div>    runApplication();</div><div>}</div><div><br></div><div>void runServer()</div><div>{</div><div>    auto settings = new HTTPServerSettings;</div><div>    settings.options |= HTTPServerOption.reusePort;</div><div>    settings.port = 3000;</div><div>    settings.serverString = null;</div><div>    listenHTTP(settings, &handleRequest);    </div><div>}</div><div><br></div><div>void handleRequest(HTTPServerRequest req,</div><div>                    HTTPServerResponse res)</div><div>{</div><div>    switch(req.path)</div><div>    {</div><div>    case "/": res.writeBody("Hello World", "text/plain");</div><div>        break;</div><div>    default:</div><div>        auto m = matchFirst(req.path, reg);</div><div>        string message = "Hello, ";</div><div>        auto app = appender(message);</div><div>        app.reserve(32);</div><div>        app ~= m[1];</div><div>        res.writeBody(app.data, "text/plain");</div><div>    }</div><div>}</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 30, 2017 at 5:41 PM, ade90036 via Digitalmars-d <span dir="ltr"><<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thursday, 21 September 2017 at 13:09:33 UTC, Daniel Kozak wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
wrong version, this is my letest version: <a href="https://paste.ofcode.org/qWsQikdhKiAywgBpKwANFR" rel="noreferrer" target="_blank">https://paste.ofcode.org/qWsQi<wbr>kdhKiAywgBpKwANFR</a><br>
<br>
On Thu, Sep 21, 2017 at 3:01 PM, Daniel Kozak <<a href="mailto:kozzi11@gmail.com" target="_blank">kozzi11@gmail.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
my version: <a href="https://paste.ofcode.org/RLX7GM6SHh3DjBBHd7wshj" rel="noreferrer" target="_blank">https://paste.ofcode.org/RLX7G<wbr>M6SHh3DjBBHd7wshj</a><br>
<br>
On Thu, Sep 21, 2017 at 2:50 PM, Sönke Ludwig via Digitalmars-d < <a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Am 21.09.2017 um 14:41 schrieb Vadim Lopatin:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
[...]<br>
</blockquote>
Oh, sorry, I forgot the reusePort option, so that multiple sockets can listen on the same port:<br>
<br>
    auto settings = new HTTPServerSettings("<a href="http://0.0.0.0:3000" rel="noreferrer" target="_blank">0.0.0.0:30<wbr>00</a>");<br>
    settings.options |= HTTPServerOption.reusePort;<br>
    listenHTTP(settings, &handleRequest);<br>
</blockquote></blockquote></blockquote>
<br>
Hi, would it be possible to re-share the example of vibe.d woth multithreaded support.<br>
<br>
The pastebin link has expired and the pull request doesnt have the latest version.<br>
<br>
Thanks<br>
<br>
Ade<br>
</blockquote></div><br></div>