Skip to content

Commit

Permalink
Renamed proxyAddress to proxyHost
Browse files Browse the repository at this point in the history
Host is more appropriate in this context
  • Loading branch information
GrzybDev committed Jun 23, 2024
1 parent d8a90ef commit 2aa77e9
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ You can change the default behavior of the hook by creating JSON config named `c
| patches.DNS | Patch game DNS resolution (redirects all game requests to localhost) | Boolean (true/false) | true |
| patches.SSL | Patch game SSL certificate verification (required for hook proxy to work) | Boolean (true/false) | true |
| proxy.enable | Enable/Disable hook proxy | Boolean (true/false) | true |
| proxy.address | IP Address or Domain Name of custom server implementation | Any string | bfbc2.grzyb.app |
| proxy.host | IP Address or Domain Name of custom server implementation | Any string | bfbc2.grzyb.app |
| proxy.port | Port of custom server implementation | Unsigned short (Range 0-65535) | 443 |
| proxy.path | Endpoint path | Any string | /ws |
| proxy.secure | Use secure connection (wss) or not encrypted connection (ws) | Boolean (true/false) | true |
Expand Down
2 changes: 1 addition & 1 deletion dinput8/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Config::Config()

// Section - Proxy
hook->proxyEnable = pt.get("proxy.enable", true);
hook->proxyAddress = pt.get("proxy.address", "bfbc2.grzyb.app");
hook->proxyHost = pt.get("proxy.host", "bfbc2.grzyb.app");
hook->proxyPort = pt.get("proxy.port", HTTPS_PORT);
hook->proxyPath = pt.get("proxy.path", "/ws");
hook->proxySSL = pt.get("proxy.secure", true);
Expand Down
2 changes: 1 addition & 1 deletion dinput8/Config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Config

/* Proxy */
bool proxyEnable;
std::string proxyAddress;
std::string proxyHost;
USHORT proxyPort;
std::string proxyPath;
bool proxySSL;
Expand Down
2 changes: 1 addition & 1 deletion dinput8/ConnectionPlasma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void ConnectionPlasma::HandleHandshake(const boost::system::error_code& error)
BOOST_LOG_TRIVIAL(debug) << "New connection, initializing...";

const auto config = &Config::GetInstance();
ws_->Connect(config->hook->proxyAddress, config->hook->proxyPort, config->hook->proxyPath);
ws_->Connect(config->hook->proxyHost, config->hook->proxyPort, config->hook->proxyPath);

gameSocket_.async_read_some(buffer(buffer_, PACKET_MAX_LENGTH),
boost::bind(&ConnectionPlasma::HandleRead, shared_from_this(),
Expand Down
4 changes: 2 additions & 2 deletions dinput8/HttpHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ void HttpHandler::ProcessRequest(const system::error_code& error, size_t bytesTr
const auto config = &Config::GetInstance();

// Set up an HTTP GET request message
request_.set(http::field::host, config->hook->proxyAddress);
request_.set(http::field::host, config->hook->proxyHost);

try
{
response_ = http_->Execute(config->hook->proxyAddress, config->hook->proxyPort, request_);
response_ = http_->Execute(config->hook->proxyHost, config->hook->proxyPort, request_);

http::async_write(game_socket_, response_, bind(&HttpHandler::HandleWrite, shared_from_this(),
asio::placeholders::error,
Expand Down

0 comments on commit 2aa77e9

Please sign in to comment.