Git Product home page Git Product logo

Comments (5)

pimterry avatar pimterry commented on June 18, 2024

The desktop shell is effectively just a browser - it doesn't read files directly, instead it loads a URL where your UI is hosted.

By default it loads https://app.httptoolkit.tech, which is the production UI deployment. That's set here.

You can either change that URL directly and make a separate desktop app build, or run the normal desktop build with an APP_URL env var set pointing to a different URL (though now that I actually look at this, I might change that to HTTPTOOLKIT_APP_URL in future, just to avoid conflicts here).

If you want to just test locally, you can run npm run start:dev and it will load http://local.httptoolkit.tech:8080 (this resolves to localhost - it's the default UI URL if you run npm run start in the UI repo) and won't start its own server (it assumes you'll run one separately - you can do so either by using npm run start in the UI, or by running npm run start:web in the UI and npm run start in a server, if you want to use your own local server build).

Note that for security reasons, the official server releases will only allow connections from app.httptoolkit.tech. That's defined here. Non-prod builds however will also allow connections from any localhost address. If you want to host a UI on a different URL then you'll need to tweak your server to allow requests from that URL first. Whatever you do though, don't allow all URLs to access this! The server API is very powerful - if you allow requests from any origin, then any web page you load in your browser on the same machine could send requests to your server to launch process & configure proxies etc.

Does that make sense?

from httptoolkit-desktop.

Starmania avatar Starmania commented on June 18, 2024

Hey, after some work because I was trying to do the exact same thing, this make sense, and it works ! I have only one question, is there a way to put (or launch) the UI server in local directly when launching the desktop app ?

from httptoolkit-desktop.

pimterry avatar pimterry commented on June 18, 2024

If you're not modifying the UI, then you can just run this repo with npm start and it'll use the existing UI from app.httptoolkit.tech, in which case you won't need a local server.

If you are modifying the UI, you'll need a separate checkout & web server for that anyway, so yes you do need to separately launch that - the desktop app can't know where that is, and in general I try to keep the components independent so far as possible. You could plausibly build a quick script to launch both if you want to though with a few lines of bash to glue everything together with the right paths for your machine.

from httptoolkit-desktop.

Starmania avatar Starmania commented on June 18, 2024

Ok thanks 👍. I think it will be the best choice, I was just wandering if there is a less sketchy way to do it...
Anyway, thanks for your answers! I probably will try to make a PR for localization support, I have some idea how make this

from httptoolkit-desktop.

pimterry avatar pimterry commented on June 18, 2024

PRs for localization support would be very welcome indeed! Feel free to open a issue in the UI if you want to discuss that or if you have any questions at all.

from httptoolkit-desktop.

Related Issues (20)

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.