dfleury2 / beauty Goto Github PK
View Code? Open in Web Editor NEWA Simple C++ Http server/client above Boost.Beast
License: MIT License
A Simple C++ Http server/client above Boost.Beast
License: MIT License
Is it possible to consume the package through conan? I can't find it in conan center
Hi,
Is beauty client supports to request headers?
I checked at client.hpp and could not able to find it.
Is there any to set threads for http client?
Seems like http client has only one worker thread to process async requests in order.
For Example :
/endpoint1 (3 sec processing delay)
/endpoint2 (10 sec processing delay)
When sending 10 request using http client async way, still waits response from server then send next request.
Hi,
Currently client can able to send "http" requests (ie. http://httpbin.org/get), but can not able to send "https" requests (ie. https://httpbin.org/get)
Is this a bug or something I missed?
Thank you
How should I add to CMakeLists.txt?
for rapidyaml I have this for example:
add_subdirectory(deps/rapidyaml)
target_include_directories(test PRIVATE deps/rapidyaml/src)
target_link_libraries(test PRIVATE ryml)
In readme, seems minor typo.
replace cmake .. -DCMAKE_BUILD_TYPE=Release by cmake .. -DCMAKE_BUILD_TYPE=Release -DCONAN_false to not use Conan. Hope your the dependencies are found on your Linux.
which can be
replace cmake .. -DCMAKE_BUILD_TYPE=Release by cmake .. -DCMAKE_BUILD_TYPE=Release -DCONAN=false to not use Conan. Hope your the dependencies are found on your Linux.
Even though correcting that, cmake toolchain try to find conan
so it's trying to install this library through conan.. so seems like disabling conan not working as expected.
While digging through root level CMakeLists.txt
file, below can be found so probably that needs to be taken under CONAN
macro which worked fine for me. Also didn't understand use case of empty CONAN_EXPORTED
.
if (CONAN_EXPORTED)
else()
if (NOT EXISTS ${CMAKE_BINARY_DIR}/conan_toolchain.cmake)
include(${PROJECT_SOURCE_DIR}/cmake/conan.cmake)
conan_cmake_autodetect(settings)
conan_cmake_install(PATH_OR_REFERENCE ${PROJECT_SOURCE_DIR}/conanfile.py
PROFILE ${CONAN_PROFILE}
PROFILE_BUILD ${CONAN_PROFILE}
BUILD missing
SETTINGS ${settings}
)
endif()
endif()
include(${CMAKE_BINARY_DIR}/conan_toolchain.cmake)
which can be
if (CONAN)
if (NOT EXISTS ${CMAKE_BINARY_DIR}/conan_toolchain.cmake)
include(${PROJECT_SOURCE_DIR}/cmake/conan.cmake)
conan_cmake_autodetect(settings)
conan_cmake_install(PATH_OR_REFERENCE ${PROJECT_SOURCE_DIR}/conanfile.py
PROFILE ${CONAN_PROFILE}
PROFILE_BUILD ${CONAN_PROFILE}
BUILD missing
SETTINGS ${settings}
)
else()
include(${CMAKE_BINARY_DIR}/conan_toolchain.cmake)
endif()
endif()
after running cmake --build . -j4
I get:
`fatal error: boost/json.hpp: No such file or directory #include <boost/json.hpp>
Hi,
Due to investigation,
application::~application()
{
stop(false); // memory leak possibility which not stop timers
}
but timers are not destructing :
void
application::stop(bool reset)
{
...
if (reset) {
for(auto&& t : timers) {
t->stop();
}
timers.clear();
}
...
}
In timer.hpp, _timer
member uses _app.ioc()
but seems like ioc is stopped on application destruction.
My question is why destruction of application set reset false?
hi dev, just came here to say thanks for developing this awesome library. glad to be here and creating the first issue before it become famous! i'm currently using it in production and it works like a charm.
This is my code:
server.add_route("/person")
.post([](const auto& req, auto& res) {
std::istringstream iss(req.body());
std::string id, name;
iss >> id >> name;
std::cout << id << std::endl;
});
This is the client call:
curl --location --request POST 'http://<ip>:<port>/person' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'id=88' \
--data-urlencode 'name=rrr'
it prints id=88&name=rrr
instead of 88
.
Hi,
I want to use your http server in an app. how can I integrate it with my bazel build?
Also, what json library do you suggest to parse the incoming http request and create the http resonse?
Thanks
I tried building this project with conan v2.04 and it seems to be broken. After some digging around turns out your current conanfile.py is not compatible with conan 2.0.
source : https://docs.conan.io/1/migrating_to_2.0/recipes.html.
The fix is simple.
But it seems like libssl doesn't support conan 2.0 either so compiling with libssl doesn't work.
here's the error from conan 2.04
ImportError: cannot import name 'ConanFile' from 'conans' (/home/gibi/.local/lib/python3.10/site-packages/conans/__init__.py)
Here is the fix according the above mentioned link
- from conans import ConanFile
+ from conan import ConanFile
- def requirements(self):
+ def build_requirements(self):
Cheers ๐บ
In the build instructions from Linux, it should have a .., not .
conan install .. -pr default -pr:b default -of ..
Is it possible to add a route with queries, e.g. server.add_route("/person?id") and then in the request http://127.0.0.1:8085/person?id=1
Hello, thank you for this awesome tool on top of beast.
While building for Mac OS(clang-13.1), noticed below warning. So seems like either explicitly defaulted functions at server.hpp
can be removed or application.hpp
needs to be fixed.
~/beauty/include/beauty/server.hpp:64:13: warning: explicitly defaulted move assignment operator is implicitly deleted [-Wdefaulted-function-deleted]
server& operator=(server&&) = default;
^
~/beauty/include/beauty/server.hpp:100:29: note: move assignment operator of 'server' is implicitly deleted because field '_app' is of reference type 'beauty::application &'
beauty::application& _app;
^
Hi,
Thank you for your awesome library.
If i'm not mistaken, currently it is not possible to reuse an io_context for instantiating a client or server, by reusing an existing io_context we can have multiple async libraries in asio based single threaded applications without any need to deal with synchronization and concurrency problems.
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.