My server moved to Debian 10 Linux platform.
It was installed using lgsm.
After moving, webrequest does not work in plugins. (this command https://umod.org/documentation/api/web-requests)
I get an error on my web request:
Error code: 0
Error text: ConnectFailure (Invalid arguments)
I tried to specify header for request ("host", "localhost")
The error changes to:
Error code: 0
Error text: ConnectFailure (Network is unreachable)
Using "http://google.com/" fails with the "context" error above.
Using "http://*.*.*.*/" works and returns the body!
That is, if I request a local site, I get a response. But if it's external (Internet), then errors.
The server itself works well, they play on it, etc., the problem is only with requests.
Excuse me for my bad English.
Webrequest.Enqueue work only 127.0.0.1
Using 127 0 0 1 - works and return the body.
My code:
// Set a custom timeout (in milliseconds)
float timeout = 2000f;
// Set some custom request headers
Dictionary<string, string> headers = new Dictionary<string, string> { { "host", "localhost" } };
webrequest.Enqueue("http://*.*.*.*", "param1=value1", (code, response) =>
{
if (code != 200 || response == null)
{
Puts($"Failed to get answer from site: {code} {response}");
return;
}
Puts($"Site answered: 76561############ OK 76561############111111");
}, this, RequestMethod.POST, headers, timeout);
Merged post
I'll add. If in the config /serverfiles/oxide/oxide.config.json
Parameter: "WebRequestIP": set "*.*.*.*"
Then I get an error with a delay: 0 Error: ConnectFailure (Connection timed out)
If Parameter: "WebRequestIP": set the IP of my server.
Then I also get an error with a delay: 0 Error: ConnectFailure (Connection timed out)