Giter VIP home page Giter VIP logo

unity-http-debugger's Introduction

Unity HTTP Debugger

license UnityVersion openupm HowToInstall

Main Image HTTP request logging tool for Unity.

Features

Runtime Extensions

  • Extension methods to Log web requests
  • Logged requests are visible in the Request Console Window

Request Console

Open from context menu: Http Debugger/Console

  • Log, filter, search, and preview web requests from your game/app
  • Save chosen requests and responses to Request Stash

Request Inspector

Open by selecting request in Console or Stash windows

  • Preview and edit your request/response
  • Send requests and save responses

Request Stash

Open from context menu: Http Debugger/Stash

  • Go back to your saved requests to run and or edit them

Development Priorities

  • Add/polish features that can't be replaced with external apps like Postman
    • Custom and easy request logging
    • breakpoints
    • fast request/response edit/inspect
  • Stash view is less important right now as Postman does it 100 times better. Development should focus on features unique to this tool.

Dependencies

References

unity-http-debugger's People

Contributors

ernsur 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

Watchers

 avatar  avatar

unity-http-debugger's Issues

Add Request Breakpoints

  • ability to assign a breakpoint to a request ID
  • when the game tries to log a request with a breakpoint
    • pause game
    • await until user closes the mock exchange window
    • show special mock exchange window/inspector
      • allow inspecting/edit requests that will be sent
      • allow mocking response
  • add an IDE breakpoint from the editor?

Inspector header with request metadata

Create a new or utilize an Inspector header to show/edit request data

  • request name/ID
  • icon
    • console exchange
    • stash exchange
    • mock exchange
  • timestamp
  • breakpoint?

Fix CodeField ScrollView

  • add working horizontal scrolling
  • horizontal scrolling should not hide line numbers
  • MAAAAAAAYYYYYBEEE look into syntax highlighting, but it's probably too much for now.

suggestion: show more headers

image
date, expires, last-modified, authorization custom header, ... more headers are more useful.

request headers = req.Content.Headers + req.Headers
response headers = res.Content.Headers + res.Headers + res.TrailingHeaders

my code
5minlab@18cc131
(I didn't know TrailingHeaders, so my code doesn't contain res.TrailingHeaders)

Add stack trace to console request

  • Double-click to open the script, just like in the regular console
  • Stash requests should not serialize this data
    • maybe create another type of HDRequest?

Add "Save to project" for RequestData

  • The user should be able to save RequestsData to the assets folder, from Console/Stash, or directly from Exchange inspector.
  • Button for this can be added to the Exchange Inspector header #7

Optimize Log Serialization

  • Write logs to file in a readable format
  • Do not serialize HDRequests unless for editor persistent state

Better test environment

  • Create a test scene where requests are sent and logged
    • Send .NET requests
    • Send UnityWebRequests
    • Some requests could download Textures, AssetBundles, etc.
    • Use different endpoints
  • Maybe a local server help with that

Mock Exchange Window

  • when the game tries to log a request with a breakpoint
    • pause game
    • await until user closes the mock exchange window
    • show special mock exchange window/inspector
      • allow inspecting/edit requests that will be sent
      • allow mocking response

Fix: ArgumentNullException: Parameter name: _unity_self

Repro:

  • Select instance of Console Request so that inspector is drawing Exchange Editor
  • reload assembly a couple of times

Clues:

  • It seems to be connected to Inspector Element drawing an instance of Scriptable Object that is saved and loadded using InternalEditorUtility.SaveToSerializedFileAndForget.
  • This exception doesn't seem to trigger when inspecting RequestConsoleDatabase which is also saved using InternalEditorUtility.SaveToSerializedFileAndForget
  • ConsoleRequestData is different from RequestConsoleDatabase in a way that it has different hide flags

Exception:

ArgumentNullException: Value cannot be null.
Parameter name: _unity_self
UnityEditor.UIElements.InspectorElement.GetOrCreateEditor (UnityEditor.SerializedObject serializedObject) (at /Users/bokken/buildslave/unity/build/Editor/Mono/UIElements/Inspector/InspectorElement.cs:384)
UnityEditor.UIElements.InspectorElement.Reset (UnityEditor.SerializedObject bindObject) (at /Users/bokken/buildslave/unity/build/Editor/Mono/UIElements/Inspector/InspectorElement.cs:305)
UnityEditor.UIElements.InspectorElement.ExecuteDefaultActionAtTarget (UnityEngine.UIElements.EventBase evt) (at /Users/bokken/buildslave/unity/build/Editor/Mono/UIElements/Inspector/InspectorElement.cs:379)
UnityEngine.UIElements.CallbackEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) (at /Users/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Core/Events/EventHandler.cs:281)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtCurrentTargetAndPhase (UnityEngine.UIElements.EventBase evt) (at /Users/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Core/Events/EventHandler.cs:189)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at /Users/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Core/Events/EventHandler.cs:175)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetAndDefaultPhase (UnityEngine.UIElements.EventBase evt) (at /Users/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Core/Events/EventHandler.cs:180)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.SendBindingEvent[TEventType] (TEventType evt, UnityEngine.UIElements.VisualElement target) (at /Users/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Editor/Bindings/BindingExtensions.cs:84)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.BindTree (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedProperty parentProperty) (at /Users/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Editor/Bindings/BindingExtensions.cs:94)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.ContinueBinding (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedProperty parentProperty) (at /Users/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Editor/Bindings/BindingExtensions.cs:39)
UnityEditor.UIElements.Bindings.DefaultSerializedObjectBindingImplementation+BindingRequest.Bind (UnityEngine.UIElements.VisualElement element) (at /Users/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Editor/Bindings/BindingExtensions.cs:1119)
UnityEngine.UIElements.VisualTreeBindingsUpdater.Update () (at /Users/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Core/Bindings/VisualTreeBindingsUpdater.cs:272)
UnityEngine.UIElements.VisualTreeUpdater.UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase phase) (at /Users/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Core/VisualTreeUpdater.cs:111)
UnityEngine.UIElements.Panel.UpdateBindings () (at /Users/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Core/Panel.cs:973)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.UpdateSchedulers () (at /Users/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Core/UIElementsUtility.cs:255)
UnityEngine.UIElements.UIEventRegistration.UpdateSchedulers () (at /Users/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Core/UIElementsUtility.cs:105)
UnityEditor.RetainedMode.UpdateSchedulers () (at /Users/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Editor/RetainedMode.cs:55)

View layout persistence

preserve layout data like:

  • opened tab
  • TwoPaneSplit size
  • column visibility and order
    when:
  • changing request selection
  • entering playmode
    in:
  • exchange inspector
  • request console

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.