Skip to content

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updated javaeditor and reverted requested change
  • Loading branch information
Vaivaswat2244 committed Apr 17, 2025
commit 57ac5089eed18a26fb6c97824a7323c60931aefa
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions java/src/processing/mode/java/JavaEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,10 @@ public class JavaEditor extends Editor {
static final int REFERENCE_PORT = 8053;
// weird to link to a specific location like this, but it's versioned, so:
static final String REFERENCE_URL =
"https://github.com/processing/processing-website/releases/download/2022-10-05-1459/reference.zip";
"https://github.com/processing/processing4/releases/tag/processing-1300-4.4.0";
static final String REFERENCE_URL_2 = "https://github.com/processing/processing4/releases/download/processing-1300-4.4.0/processing-4.4.0-reference.zip";
Boolean useReferenceServer;
WebServer referenceServer;
ReferenceServer referenceServer;


protected JavaEditor(Base base, String path, EditorState state,
Expand Down Expand Up @@ -846,7 +847,7 @@ public void showReference(String name) {
}
if (referenceZip.exists()) {
try {
referenceServer = new WebServer(referenceZip, REFERENCE_PORT);
referenceServer = new ReferenceServer(referenceZip, REFERENCE_PORT);
useReferenceServer = true;

} catch (IOException e) {
Expand Down Expand Up @@ -889,7 +890,7 @@ private boolean isReferenceDownloaded() {

private void downloadReference() {
try {
URL source = new URL(REFERENCE_URL);
URL source = new URL(REFERENCE_URL_2);
HttpURLConnection conn = (HttpURLConnection) source.openConnection();
HttpURLConnection.setFollowRedirects(true);
conn.setConnectTimeout(15 * 1000);
Expand Down