WIP: proxy_support #3

Draft
sectapunterx wants to merge 6 commits from proxy_support into main
Member
  • Added Http, Socks5, System Configured proxy support
  • Added tests for ConnectViaProxy()
- Added Http, Socks5, System Configured proxy support - Added tests for ConnectViaProxy()
sectapunterx added 13 commits 2024-11-17 11:38:11 +00:00
sha512sum force-pushed proxy_support from 28147ee0e3 to 479c3b628b 2024-11-17 13:27:28 +00:00 Compare
sha512sum requested changes 2024-11-17 13:35:35 +00:00
sha512sum left a comment
Owner

No proxy using in ClientCreateVisitor

No proxy using in ClientCreateVisitor
@ -39,3 +39,3 @@
#
SHELLCHECK_RES=0
for FILE in $GIT_SCRIPT_FILES; do shellcheck -S warning $FILE; RET_CODE=$?; SHELLCHECK_RES=$(( RET_CODE + SHELLCHECK_RES )); done
# for FILE in $GIT_SCRIPT_FILES; do shellcheck -S warning $FILE; RET_CODE=$?; SHELLCHECK_RES=$(( RET_CODE + SHELLCHECK_RES )); done
Owner

??????

??????
sha512sum marked this conversation as resolved
@ -63,3 +63,3 @@
printf "\n\tLaunch GTests to check\n"
./larra_xmpp_tests --gtest_brief=1
# ./larra_xmpp_tests --gtest_brief=1
Owner

?????

?????
sha512sum marked this conversation as resolved
@ -33,0 +40,4 @@
#/.idea/codeStyles/Project.xml
#/.idea/vcs.xml
/.idea/
.githooks/
Owner

Why .githooks ???

Why .githooks ???
sha512sum marked this conversation as resolved
@ -160,0 +171,4 @@
// ответ от прокси-сервера
boost::asio::streambuf response;
std::size_t bytes_transferred = co_await boost::asio::async_read_until(socket, response, kEndOfHeaders, boost::asio::use_awaitable);
Owner

Code style. Use camelCase

Code style. Use camelCase
@ -160,0 +175,4 @@
// статус ответа
std::istream response_stream(&response);
std::string http_version;
Owner

camelCase

camelCase
@ -160,0 +263,4 @@
constexpr std::uint16_t kHttpPort = 8080;
return GetProxySettings<HttpProxy>(proxyEnv, kHttpPort);
}
if(const char* proxy_env = std::getenv("socks_proxy")) {
Owner

camelCase

camelCase
tests/proxy.cpp Outdated
@ -0,0 +28,4 @@
mock_socket.AddReceivedData(proxy_response);
bool connect_successful = false;
Owner

camelCase

camelCase
tests/proxy.cpp Outdated
@ -0,0 +58,4 @@
larra::xmpp::impl::MockSocket socket{executor};
// expected server responses
std::string server_response;
Owner

camelCase

camelCase
tests/proxy.cpp Outdated
@ -0,0 +121,4 @@
setenv("http_proxy", "http://proxy_host:8080", 1);
std::string target_host = "target_host";
uint16_t target_port = 80;
Owner

camelCase

camelCase
sha512sum marked this conversation as resolved
tests/proxy.cpp Outdated
@ -0,0 +163,4 @@
HttpProxy proxy{"proxy_host", 8080};
std::string target_host = "target_host";
uint16_t target_port = 80;
Owner

camelCase

camelCase
sectapunterx added 1 commit 2024-11-18 21:10:45 +00:00
Refactoring
All checks were successful
PR Check / on-push-commit-check (push) Successful in 11m29s
760bc2ab68
Owner

Still no proxy using in ClientCreateVisitor

Still no proxy using in ClientCreateVisitor
sha512sum requested changes 2024-11-19 14:03:04 +00:00
@ -33,0 +34,4 @@
#/.idea/discord.xml
#/.idea/editor.xml
#/.idea/larra.iml
#/.idea/material_theme_project_new.xml
Owner

Why commented in commit ?

Why commented in commit ?
@ -160,0 +173,4 @@
boost::asio::streambuf response;
std::size_t bytesTransferred = co_await boost::asio::async_read_until(socket, response, kEndOfHeaders, boost::asio::use_awaitable);
// статус ответа
Owner

Meaningless comments, variable names reflect what they contain. No need to duplicate. And use English for comments in code

Meaningless comments, variable names reflect what they contain. No need to duplicate. And use English for comments in code
sectapunterx added 1 commit 2024-11-21 15:46:36 +00:00
Refactoring
All checks were successful
PR Check / on-push-commit-check (push) Successful in 12m7s
665ceb9604
All checks were successful
PR Check / on-push-commit-check (push) Successful in 12m7s
This pull request is marked as a work in progress.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin proxy_support:proxy_support
git checkout proxy_support

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git checkout main
git merge --no-ff proxy_support
git checkout proxy_support
git rebase main
git checkout main
git merge --ff-only proxy_support
git checkout proxy_support
git rebase main
git checkout main
git merge --no-ff proxy_support
git checkout main
git merge --squash proxy_support
git checkout main
git merge --ff-only proxy_support
git checkout main
git merge proxy_support
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Larra/larra#3
No description provided.