문제

I am developing an Android app with an integrated webserver; in my handler (implements HttpRequestHandler) I want to retrieve the remote IP address. How can I do that ?

public abstract class MyHttpRequestHandler implements HttpRequestHandler {

@Override
public void handle(HttpRequest request, HttpResponse response,
        HttpContext httpContext) throws HttpException, IOException {
 // retrieve remote IP here...

올바른 솔루션이 없습니다

다른 팁

Are you able to pull the headers off the server? Although not always 100% accurate, refer to this article, it has some headers you can check:

Getting the client IP address: REMOTE_ADDR, HTTP_X_FORWARDED_FOR, what else could be useful?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top