A
A
Alexander Andreev2018-08-08 10:10:44
PHP
Alexander Andreev, 2018-08-08 10:10:44

Can I somehow access a remote server by changing my ip?

The essence of the problem is that there is a client's store, it communicates with the client's internal service via SOAP, this service only responds to requests from the ip of the server where the site is located (gives up the actual balances of the goods). I want to deploy an OpenServer + PhpStorm sandbox on my local to work on a project. Is it possible to somehow "pretend" to be a working server so that the client's internal service would normally return data for the sandbox on the LAN?
Almost the entire site will work anyway, with the exception of placing an order, where fresh data on balances is required.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kudis, 2018-08-08
@kudis

There are 3 solutions:
1. Open access for your IP (you can use a mask, but it's better to get a static one)
2. You can raise a proxy, tunnel, VPN on the server, connect to it locally and work from the server's IP
3. Put a "crutch tunnel" on the working server ", which will contact the server for you, simply mirroring your requests. Something like this, only you may also need to receive and pass a query string in order to send methods, since you have SOAP

if (!in_array($_REQUEST['token'],[
    'vremenniitoken' // нужен для ботов и недоброжелателей
])) {
    die();
}

header('Content-Type: application/json');
echo file_get_contents('http://url/?' . http_build_query($_REQUEST['params']));

maybe replace file_get_contents with CURL.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question