Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 126
Tried writing a reference server using jdk httpServer#1026
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Conversation
Vaivaswat2244 commented Apr 3, 2025 • edited by SableRaf
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by SableRaf
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
SableRaf commented Apr 4, 2025
Nice work @Vaivaswat2244! I didn't have a close look at the code but the server runs fine for me. I left a minor comment about the JDK version. Feel free to mark this as a draft PR and switch it back when it's ready for a review. Looking forward to seeing the download part! Thanks for your contribution 💙 |
Vaivaswat2244 commented Apr 17, 2025
I updated the source link for the download and also replaced the WebServer class. Now I'm not sure how to automate this version checking system. I researched a bit and found that using Github apis is the most suitable way for tracking version. I can try that. |
Stefterv commented Apr 18, 2025
Hi @Vaivaswat2244 Thank you for your work on this, looking good! The current version of Processing is available to you in your code through |
Vaivaswat2244 commented Apr 19, 2025
hey @SableRaf@Stefterv , privatevoiddownloadReference(){try{URLsource = newURL(getReferenceDownloadUrl());privateStringgetReferenceDownloadUrl(){StringversionName = Base.getVersionName(); Stringrevision = String.valueOf(Base.getRevision()); System.out.println("Processing Version Name: " + versionName); System.out.println("Processing Revision: " + revision); if (versionName != null && !versionName.isEmpty() && revision != null && !revision.isEmpty()){Stringurl = String.format( "https://github.com/processing/processing4/releases/download/processing-%s-%s/processing-%s-reference.zip", revision, versionName, versionName); System.out.println("Generated URL: " + url); returnurl} else{System.out.println("Using fallback URL"); return"https://github.com/processing/processing4/releases/download/processing-1300-4.4.0/processing-4.4.0-reference.zip"} }In logs I got Version Name: "unspecified" and Revision: 2147483647 (which is Integer.MAX_VALUE) |
Stefterv commented Apr 19, 2025
Hey @Vaivaswat2244 that is correct, those are the values that are expected in the development build 😅 |
Vaivaswat2244 commented Apr 19, 2025
So should I commit the changes? |
Stefterv left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thank you!
If you can delete the old WebServer.java as well that would be great, otherwise we'll delete it later.
Vaivaswat2244 commented Apr 19, 2025
Sure @Stefterv, I have deleted the WebServer class as well. |
Vaivaswat2244 commented May 17, 2025
Stefterv commented May 18, 2025 • edited by SableRaf
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by SableRaf
Uh oh!
There was an error while loading. Please reload this page.
Hi @Vaivaswat2244 Thank you for reaching out! The PR looks good and will be included in the next version of Processing when we're ready to ship the next beta. If you are interested in contributing further feel free to ask to be assigned to any other issue. |
SableRaf commented Jul 11, 2025
@all-contributors please add @Vaivaswat2244 for code |
I've put up a pull request to add @Vaivaswat2244! 🎉 |
This PR introduces ReferenceServer.java, a lightweight HTTP server to serve Processing's reference documentation locally. It replaces the previous approach with a more maintainable and efficient solution using Java's built-in HttpServer.
Changes Implemented
Used com.sun.net.httpserver.HttpServer from the JDK
Handles different MIME types (HTML, CSS, JS, images, etc.).
Runs on a separate thread to avoid blocking the main Processing IDE.
Later in this pr I will add the download modifications in the JavaEditor.java file, which is the only file find I found where the WebServer was being used
Maintainer edit: Fixes#980