D
D
Denis2018-04-16 05:51:54
Android
Denis, 2018-04-16 05:51:54

How to set ip and domain when setting up retrofit 2?

How to set retrofit 2 at the same time ip on which it should go and the domain that it should use at the same time?
For example.
Two domains x.ru and zxru are attached to ip 1.1.1.1, I need the request to go to the second domain, and if the request is sent simply to ip, then it goes to the first domain.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2018-04-16
@saboteur_kiev

IMHO this cannot be configured from the client side, it must be decided on the server side.
The client simply uses DNS and sends the URL in its HTTP header - neither the browser nor the retrofit should decide on its own where it should be redirected - it's up to the server to decide where documentROOT is for 1.1.1.1, for x.ru or for zxru.
Do you have access to the server?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question