Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify our HTTP dependencies #347

Open
kelson42 opened this issue Apr 29, 2020 · 12 comments
Open

Simplify our HTTP dependencies #347

kelson42 opened this issue Apr 29, 2020 · 12 comments

Comments

@kelson42
Copy link
Collaborator

kelson42 commented Apr 29, 2020

We use currently three HTTP libraries in Kiwix library:

  • httplib
  • libmicrohttpd
  • libcurl

These is probably 2 too much.

I would like we consider as well https://nghttp2.org

@stale
Copy link

stale bot commented Jul 29, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

@stale stale bot added the stale label Jul 29, 2020
@kelson42
Copy link
Collaborator Author

kelson42 commented Nov 11, 2020

@mgautierfr @veloman-yunkan As we are improving the CI/CD for Windows it appears that we would benefit to make a decision here. On my side, it looks like httplib is quite good, but I wonder a bit if the server part is really good at handling a high throughput traffic (pooling strategy, etc...) like we have at https://library.kiwix.org/. I don't think libcurl has anything to manager a HTTP server.

@stale stale bot removed the stale label Nov 11, 2020
@kelson42
Copy link
Collaborator Author

On the server side, https://nghttp2.org has always made great first impression to me. Maybe we have here two problems: a lib for the client side and a lib for the server side.

@mgautierfr
Copy link
Member

On my side, it looks like httplib is quite good, but I wonder a bit if the server part is really good at handling a high throughput traffic (pooling strategy, etc...)

It seems httplib has everything we need : https://github.com/yhirose/cpp-httplib#default-thread-pool-support and https://github.com/yhirose/cpp-httplib#override-the-default-thread-pool-with-yours

On the server side, nghttp2.org has always made great first impression to me.

It doesn't to me :)
The C api seems really low level and the c++ api is experimental and depends on boost.

@kelson42
Copy link
Collaborator Author

Pinging @legoktm as he might have a feedback about this ticket.

@legoktm
Copy link
Member

legoktm commented Nov 19, 2020

I have a preference to any library that is already relatively well maintained in Debian :)

Both libcurl and libmicrohttpd are popular and used by other projects and have good track records behind them.

I didn't really give httplib a good look earlier since it was just being used in tests, I don't really know how widely it's used but I expect HTTP servers to be robust and have good security properties because of how often they're attacked. And then any HTTP client should properly use the system certificate store and crypto policies, etc. My quick search through the code indicates that httplib doesn't support stuff like HSTS, which is disappointing (but might not be a concern?).

@kelson42
Copy link
Collaborator Author

My quick search through the code indicates that httplib doesn't support stuff like HSTS, which is disappointing (but might not be a concern?).

This is a quite interesting point because to support SW based ZIM file, we will need to support HTTPS. Not sure what is the value of HTTPS with HSTS?!

@mgautierfr
Copy link
Member

Maybe we have here two problems: a lib for the client side and a lib for the server side.

Probably yes. We use libcurl mainly to pilot the aria2c tools (and remote favicon listed in catalog). If we change this, it would be even better to have a websocket client. It would allow us to be notified by aria2c instead of polling it.
(And we use a subprocess because we fail to link/compile with libaria2 on windows. I don't remember why but we may rework on that and simply the client http library).

I didn't really give httplib a good look earlier since it was just being used in tests, I don't really know how widely it's used but I expect HTTP servers to be robust and have good security properties because of how often they're attacked. And then any HTTP client should properly use the system certificate store and crypto policies, etc. My quick search through the code indicates that httplib doesn't support stuff like HSTS, which is disappointing (but might not be a concern?).

On the server side, I would tend to say it (https) is not our problem. If you want https, use a reverse-proxy to do it (it is pretty easy with nginx, httpd or candy). It will be more secured, integrated with the distribution (and made by people who fully understand what they are doing with the certificate).

@kelson42
Copy link
Collaborator Author

kelson42 commented Dec 1, 2020

Related to kiwix/kiwix-tools#416

@stale
Copy link

stale bot commented Jan 31, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

@stale stale bot added the stale label Jan 31, 2021
@kelson42
Copy link
Collaborator Author

kelson42 commented Oct 8, 2023

Related to kiwix/kiwix-desktop#957 (comment).

I suspect that libmicrohhtpd and libcurl might be the final choices.

@stale stale bot removed the stale label Oct 8, 2023
@kelson42 kelson42 changed the title Simplify our HTTP dependences Simplify our HTTP dependencies Aug 7, 2024
@kelson42 kelson42 added this to the 15.0.0 milestone Dec 31, 2024
@kelson42
Copy link
Collaborator Author

libaria2 is also a candidate IMHO, see #1172

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants