adibfara / watchtower Goto Github PK
View Code? Open in Web Editor NEW🗼Observe OKHttp API Calls With Request And Response Details Right In Your Browser!
🗼Observe OKHttp API Calls With Request And Response Details Right In Your Browser!
I use it as demo in my android project,
but it crash.
the log is :
05-29 15:44:07.939 18167-18167/com.zx.ksfensi E/CrashReport: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/snakydesign/watchtower/interceptor/WatchTowerInterceptor; at com.zx.ksfensi.CoupleApp.onCreate(CoupleApp.java:45) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1016) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4794) at de.robv.android.xposed.XposedBridge.invokeOriginalMethodNative(Native Method) at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:334) at android.app.ActivityThread.handleBindApplication(<Xposed>) at android.app.ActivityThread.access$1700(ActivityThread.java:169) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1495) at android.os.Handler.dispatchMessage(Handler.java:111) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5581) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:968) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:763)
and I import this lib is :
implementation 'com.snakyapps.watchtower:core:1.0.0' implementation 'com.snakyapps.watchtower:interceptor-okhttp:1.0.0'
use it in my okhttpclient:
.addInterceptor(new WatchTowerInterceptor())
It would be very helpful to sort requests by new (rather than old which it seems to currently be)
Can run in a computer browser, such as Tomcat
jcenter
is at end of life. Can you please upload it to mavenCentral
? Thanks
version: 1.1.0
I can reach the url http://127.0.0.1:8085/
, but nothing showing on screen when I do some http requests with retrofit.
code
// okhttp
OkHttpClient.Builder builder = new OkHttpClient.Builder();
if (BuildConfig.DEBUG) {
builder.addInterceptor(new WatchTowerInterceptor());
}
builder
.cache(cache)
.addInterceptor(logInterceptor)
.addInterceptor(headerInterceptor)
OkHttpClient okHttpClient = builder.build();
// retrofit
new Retrofit.Builder()
.client(okHttpClient)
.addConverterFactory(GsonConverterFactory.create())
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.baseUrl(baseUri)
.build();
// activity
if (BuildConfig.DEBUG) {
WebWatchTowerObserver[] towers = new WebWatchTowerObserver[1];
towers[0] = new WebWatchTowerObserver(8085, 5004);
WatchTower.INSTANCE.start(towers, 100);
}
and execute the adb command adb forward tcp:8085 tcp:8085
this class is not public so it cannot be referenced
127.0.0.1 refused to connect.
Try:
Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED
Using the library from Java is a little hard.
With a couple of annotations, we can improve it much more.
I'll see if I can manage to send a PR for this
this is the current code we need in java:
TowerObserver[] observers = {new WebWatchTowerObserver(8085, 5003)};
WatchTower.INSTANCE.start(observers, 100);
Currently, when opening the library class files we only see the compiled code.
Having the library code and documentation helps a lot when using the library
I'll see if I can manage to send a PR for this
it would be awesome to be able to collapse JSON objects and arrays in the response / request body viewer
hello, I tryied to use this util for monitoring my api, but I see nothing in web browser:
I use this util in my project pretty like this:
TowerObserver[] observers = new WebWatchTowerObserver[1];
observers[0] = new WebWatchTowerObserver(8085, 5003);
WatchTower.INSTANCE.start(observers, 100);
In logcat I saw WatchTower started, listening on ....
, but in browser's screen as you see, nothing happen.
So, what can be the reason of this? Thank you for soon answer
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.