Giter VIP home page Giter VIP logo

microrestd's People

Contributors

foxik avatar

Stargazers

Paul G avatar Nathan Glenn avatar  avatar  avatar Šimon Let avatar  avatar  avatar Arif Qureshi avatar mmm avatar Pantelis Koukousoulas avatar wyrover avatar David G. F. avatar Paulo Gois avatar

Watchers

Ondřej Plátek avatar  avatar James Cloos avatar Rudolf Rosa avatar Ondřej Košarko avatar  avatar Amir Kamran avatar Paulo Gois avatar Jan Hajic avatar Šimon Let avatar  avatar  avatar

microrestd's Issues

How to enable Keep-Alive?

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.