JSON demo server

Target for Exercise A: Custom editor tab. The server returns minified JSON so your custom JSON editor tab has something worth pretty-printing.

Run

Download JsonDemo.java

No build step and no dependencies. Run it from IntelliJ or from a terminal.

IntelliJ

  1. Right-click the src folder and go to New > Directory. IntelliJ suggests standard source folders: select test/java.
    IntelliJ creates src/test/java and marks it as a test sources root. The starter project ships only src/main/java, so you add this folder yourself.
  2. Drag JsonDemo.java into the new src/test/java folder.
  3. Click the green Run arrow in the gutter next to main, or right-click the file and click Run ‘JsonDemo.main()’.

IntelliJ runs the file with the project SDK. Keeping it in src/test/java also keeps it out of your extension JAR. Stop it with the red Stop button.

Terminal

You need a JDK 21 or later on your PATH:

java JsonDemo.java        # http://localhost:8889
java JsonDemo.java 9000   # custom port

Stop with Ctrl+C.

Note: If you let IntelliJ download the JDK for you (File > Project Structure > SDK > Download JDK), that JDK is not on your terminal’s PATH. Running java JsonDemo.java then fails with a “command not found” error. Run it from IntelliJ instead, or install a standalone JDK 21.

Endpoints

Path Content-Type Purpose
/ text/html Index with clickable links (browse to fill proxy history)
/api/users application/json A minified JSON array
/api/order application/json A minified nested object
/api/deep application/json Deeply nested minified JSON
/api/not-json text/plain Negative test: Burp does not show your JSON tab

To view the responses:

  1. Click the browser icon in the top-right of Burp to open Burp’s browser, then go to http://localhost:8889/. This routes the traffic through Burp.
  2. View the /api/* responses in the message editor.