We are using Paxton Software and that is running on a Windows Server. The Windows Server is hosted and accessible by both a domain name (winserver.domain.com) and IP-address.
On the Windows Server, Paxton Software is running and they have a Web API (REST) using nginx. We can call the API on the Windows Server by using localhost:8080 as hostname (using RDP). So far, so good.
Now, we would like to create a PHP application that is connecting to multiple Web API's of Paxton. Basically, it should connect to multiple Windows Servers and it should be possible to call the API endpoint.
What we've tried: We tried to use CURL to do a request to the windows server. We tried to setup a proxy to the IP-address:3389 (that's the port RDP is using), using a PROXYUSERPWD to login. Sadly, that didn't work, because of the following error: Recv failure: Connection was reset. The script:
$url = 'http://localhost:8080/webapihelp/';
$proxy = 'http://0.0.0.0:3389';
$proxyauth = 'username123:password456';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_PROXY, $proxy);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyauth);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
$curlResponse = curl_exec($ch);
var_dump(curl_error($ch));
curl_close($ch);
Is it possible to connect to the Windows Server directly? If not, what do we need in order to achieve that goal?
There are plenty of options to do so.
netsh interface portproxy add v4tov4 listenaddress=localaddress listenport=localport connectaddress=destaddress connectport=destport
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.
PHP (from the English Hypertext Preprocessor - hypertext preprocessor) is a scripting programming language for developing web applications. Supported by most hosting providers, it is one of the most popular tools for creating dynamic websites.
The PHP scripting language has gained wide popularity due to its processing speed, simplicity, cross-platform, functionality and distribution of source codes under its own license.
https://www.php.net/
Welcome to the Q&A site for web developers. Here you can ask a question about the problem you are facing and get answers from other experts. We have created a user-friendly interface so that you can quickly and free of charge ask a question about a web programming problem. We also invite other experts to join our community and help other members who ask questions. In addition, you can use our search for questions with a solution.
Ask about the real problem you are facing. Describe in detail what you are doing and what you want to achieve.
Our goal is to create a strong community in which everyone will support each other. If you find a question and know the answer to it, help others with your knowledge.