简体   繁体   English

Android:代理(中继)服务器请求

[英]Android: Proxy (Relay) Server Requests

I have a server and an android app. 我有一个服务器和一个Android应用程序。 My server want to request a destination but with the IP of the android device that my app is running on. 我的服务器想要请求目的地,但要使用运行我的应用的android设备的IP。 So I need to proxy the requests (relay them) in my app so the destination could see the client's IP but the server. 因此,我需要在我的应用程序中代理请求(将它们中继) ,以便目标可以看到客户端的IP,但可以看到服务器。 You can see my explanation in the picture: 您可以在图片中看到我的解释:

在此处输入图片说明

How can I do this in my app? 如何在我的应用程序中执行此操作?

Yes this could be done but not just with relays; 是的,可以做到这一点,而不仅仅是继电器。 you also need to port forwarding mechanism in between. 您还需要在两者之间建立端口转发机制。 Here is how I would try to do this: 这是我将尝试执行的操作:

Local portforward the requests of the server onto a dedicated port on your android device and then from their call the Destination server via your relay mechanism which could be fulfilled very succicntly by LittleProxy like solution. Local portforward端口将server的请求Local portforward到您的android设备上的专用端口,然后通过您的中继机制从它们调用Destination服务器,这可以通过LittleProxy之类的解决方案非常简单地实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM