Giter Site home page Giter Site logo

adibfara / watchtower Goto Github PK

View Code? Open in Web Editor NEW
308.0 6.0 18.0 2.08 MB

🗼Observe OKHttp API Calls With Request And Response Details Right In Your Browser!

Kotlin 63.49% HTML 4.59% CSS 18.25% JavaScript 12.62% Shell 0.09% Java 0.97%
kotlin android networking okhttp retrofit2

watchtower's People

Contributors

adibfara avatar william-reed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

watchtower's Issues

how can I use it in android project?

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())

This site can’t be reached

127.0.0.1 refused to connect.

Try:

Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED

Browser show blank

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.
blank

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

not tracks api calls

hello, I tryied to use this util for monitoring my api, but I see nothing in web browser:
image
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

Java introp

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);

No option to sort requets

It would be very helpful to sort requests by new (rather than old which it seems to currently be)

include documentation and source with the artifacts

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.