You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been trying to run littleproxy from my Android app. Below, you will find the code.
Before publishing this post, I searched through StackOverflow and the web for information on running littleproxy on Android devices. I could not find answers to my questions below. There is very little information about littleproxy on Android.
On my test Android phone, a Huawei Mate 20 Pro running Androind 9, I enabled proxy manually on the Wifi network I am using as follows:
Proxy hostname - 127.0.0.1
Proxy port - 8100
The logs posted by littleproxy are as follows:
03-20 18:46:48.345: I/DefaultHttpProxyServer(27269): - withAddress - /127.0.0.1:8100
03-20 18:46:48.547: I/DefaultHttpProxyServer(27269): Starting proxy at address: {} - /127.0.0.1:8100
03-20 18:46:48.549: D/ServerGroup(27269): Initializing thread pools for {} with {} acceptor threads, {} incoming worker threads, and {} outgoing worker threads - TCP - 2 - 8 - 8
03-20 18:46:48.558: I/DefaultHttpProxyServer(27269): Proxy listening with TCP transport
03-20 18:46:48.589: I/DefaultHttpProxyServer(27269): Proxy started at address: {} - /127.0.0.1:8100
After proxy starts as the above logs seem to indicate, I try to access a (any) site on the web and I am unable to do so.
Based on the code (below), the only sites I should not be able to access are ones like http://httpbin.org/image/png
I have four questions/issues I hope someone can help me answer:
Is setting the address of the proxy server on an Android device to 127.0.0.1 allowed? If not what can it be set to? Can I use port 8100, or is there a preset port I should be using (e.g. 8080) (I don't think so, just checking to make sure)?
How can I check whether the littleproxy proxy server is running after I start it (see code below)? Do I need to add code to ensure that it keep running?
Is the littleproxy start call (see code below) correct?
Does anyone have a successful experience of running a local proxy on an Android device without rooting the device? If yes, what's the proxy application used?
Thanks for any help in addressing these issues.
Code which calls littleproxy from main activity
Log.i(TAG, " - onCreate - About to run BlockingFilterProxy.main(args) --- ");
String[] args = new String[1];
BlockingFilterProxy.main(args);
Log.i(TAG, " - onCreate - Returned from BlockingFilterProxy.main(args) --- ");
Hi,
I have been trying to run littleproxy from my Android app. Below, you will find the code.
Before publishing this post, I searched through StackOverflow and the web for information on running littleproxy on Android devices. I could not find answers to my questions below. There is very little information about littleproxy on Android.
On my test Android phone, a Huawei Mate 20 Pro running Androind 9, I enabled proxy manually on the Wifi network I am using as follows:
Proxy hostname - 127.0.0.1
Proxy port - 8100
The logs posted by littleproxy are as follows:
03-20 18:46:48.345: I/DefaultHttpProxyServer(27269): - withAddress - /127.0.0.1:8100
03-20 18:46:48.547: I/DefaultHttpProxyServer(27269): Starting proxy at address: {} - /127.0.0.1:8100
03-20 18:46:48.549: D/ServerGroup(27269): Initializing thread pools for {} with {} acceptor threads, {} incoming worker threads, and {} outgoing worker threads - TCP - 2 - 8 - 8
03-20 18:46:48.558: I/DefaultHttpProxyServer(27269): Proxy listening with TCP transport
03-20 18:46:48.589: I/DefaultHttpProxyServer(27269): Proxy started at address: {} - /127.0.0.1:8100
After proxy starts as the above logs seem to indicate, I try to access a (any) site on the web and I am unable to do so.
Based on the code (below), the only sites I should not be able to access are ones like
http://httpbin.org/image/png
I have four questions/issues I hope someone can help me answer:
Is setting the address of the proxy server on an Android device to 127.0.0.1 allowed? If not what can it be set to? Can I use port 8100, or is there a preset port I should be using (e.g. 8080) (I don't think so, just checking to make sure)?
How can I check whether the littleproxy proxy server is running after I start it (see code below)? Do I need to add code to ensure that it keep running?
Is the littleproxy start call (see code below) correct?
Does anyone have a successful experience of running a local proxy on an Android device without rooting the device? If yes, what's the proxy application used?
Thanks for any help in addressing these issues.
Code which calls littleproxy from main activity
BlockingFilterProxy code
package com.android.contextq.gatekeepertolltaker.proxy.filters;
import android.util.Log;
import java.net.InetSocketAddress;
import java.nio.charset.Charset;
import java.util.Date;
import org.littleshoot.proxy.HttpFilters;
import org.littleshoot.proxy.HttpFiltersAdapter;
import org.littleshoot.proxy.HttpFiltersSource;
import org.littleshoot.proxy.HttpFiltersSourceAdapter;
import org.littleshoot.proxy.impl.DefaultHttpProxyServer;
import org.littleshoot.proxy.impl.ProxyUtils;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.handler.codec.http.DefaultFullHttpResponse;
import io.netty.handler.codec.http.HttpHeaders;
import io.netty.handler.codec.http.HttpObject;
import io.netty.handler.codec.http.HttpRequest;
import io.netty.handler.codec.http.HttpResponse;
import io.netty.handler.codec.http.HttpResponseStatus;
import io.netty.handler.codec.http.HttpVersion;
/**
*/
public class BlockingFilterProxy {
// .withAddress(new InetSocketAddress("10.125.24.28",8100))
// .withPort(PORT)
.withAllowLocalOnly(false)
.withFiltersSource(filtersSource)
.withName("BlockingFilterProxy")
.start();
}
}
The text was updated successfully, but these errors were encountered: