ufal / microrestd Goto Github PK
View Code? Open in Web Editor NEWMicroRestD is a small C++11 cross-platform REST server built on top of libmicrohttpd http://www.gnu.org/software/libmicrohttpd/.
License: Mozilla Public License 2.0
MicroRestD is a small C++11 cross-platform REST server built on top of libmicrohttpd http://www.gnu.org/software/libmicrohttpd/.
License: Mozilla Public License 2.0
How to make microrestd
send Connection: Keep-Alive
header?
I'm asking because nametag REST server is not sending Connection: Keep-Alive
header. (afaik)
It seems that libmicrohttpd
sends the Connection: Keep-Alive
header by default but microrestd
does not.
I have noticed that tests/libmicrohttpd_fileserver
sends Connection: Keep-Alive
header but tests/fileserver
does not.
Reproduce/What I did
Compile tests.
cd tests
make
echo "FILE_CONTENT" > filename # create dummy file
Run tests/libmicrohttpd_fileserver
>>> ./libmicrohttpd_fileserver 8080
Running...
Test Keep-Alive
>>> curl -v 'http://127.0.0.1:8080/filename' --keepalive-time 42
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> GET /filename HTTP/1.1
> Host: 127.0.0.1:8080
> User-Agent: curl/7.58.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Connection: Keep-Alive
< Content-Length: 13
< Date: Tue, 20 Feb 2018 16:27:15 GMT
<
FILE_CONTENT
* Connection #0 to host 127.0.0.1 left intact
Notice < Connection: Keep-Alive
and * Connection #0 to host 127.0.0.1 left intact
.
Run tests/fileserver
>>> ./fileserver 8080 10 10
Tue 20. Feb 2018 17:27:31 REST server starting, port 8080, max connections 10, timeout 0, max request body size 0, min generated 1024.
Test Keep-Alive
>>> curl -v 'http://127.0.0.1:8080/filename' --keepalive-time 42
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> GET /filename HTTP/1.1
> Host: 127.0.0.1:8080
> User-Agent: curl/7.58.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Connection: close
< Access-Control-Allow-Origin: *
< Content-Type: application/octet-stream
< Date: Tue, 20 Feb 2018 16:27:37 GMT
<
FILE_CONTENT
* Closing connection 0
Notice < Connection: close
and * Closing connection 0
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.