A
A
Alexey Shashenkov2017-06-05 23:47:43
PHP
Alexey Shashenkov, 2017-06-05 23:47:43

What is the best way to organize communication between 2 servers via HTTP(POST)?

I want to create a connection between 2 servers A and B.
I'm going to send sql queries and links to download files.
Now I made 2 checks for B by ip and a known key that I pass in a request from A.
How secure is it and how can you still be secure at the PHP level?
Is it possible to change the IP in the request?
As an improvement option, I see to send a request to server B with a link to download the command on server A. Even if someone gets the opportunity to send requests deeper than protection, they will not be able to force the server to perform an action.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav, 2017-06-06
@teknik2008

As an option:
1. Well, yes, you can organize something like a hook, when server 1 pulls the url of server 2 when it does something.
2. You can make the servers be in a closed network if you don't need them publicly.
3. Make requests on specific ports, not 80
4. Pass the key, add simple authentication
5. You can get confused and do something like end to end encryption, through the public key of another server
7. Add headers only known to you to the request, with encrypted value

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question