Skip to content

Commit 56a1755

Browse files
authored
feat: adjust server startup to use autoassigned ports (#198)
This sets the default port to 0, which will cause the server to automatically assign a port. The port is then printed to the console in the startup message and can be parsed by clients. Signed-off-by: Olaf Lessenich <olessenich@eclipsesource.com>
1 parent ff9ceb9 commit 56a1755

4 files changed

Lines changed: 4 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
- EMFModelStateImpl and EMFNotationModelStateImpl classes have been added
2525
- Related Modules have been updated to inject these GModelState sub-types as a Singleton
2626
- [validation] Add explicit support and API for live and batch validation [#200](https://github.com/eclipse-glsp/glsp-server/pull/200)
27+
- [server] Default ports have changed from 5007 (and 8081 for websockets) to 0, which implies autoassignment by the OS [#198](https://github.com/eclipse-glsp/glsp-server/pull/198)
2728

2829
## [v1.0.0 - 30/06/2022](https://github.com/eclipse-glsp/glsp-server/releases/tag/v1.0.0)
2930

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ To run the Workflow Diagram example server standalone JAR, run this command in y
9090
-j,--jettyLogLevel <arg> Set the log level for the Jetty websocket server.
9191
[default='INFO']
9292
-l,--logLevel <arg> Set the log level. [default='INFO']
93-
-p,--port <arg> Set server port. [default='5007']
93+
-p,--port <arg> Set server port. [default='0']
9494
-w,--websocket Use websocket launcher instead of default launcher.
9595
```
9696

examples/org.eclipse.glsp.example.workflow/Start_Workflow_Example_Server.launch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
1212
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.glsp.example.workflow.launch.WorkflowServerLauncher"/>
1313
<stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value="org.eclipse.glsp.example.workflow"/>
14-
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="--logLevel=debug"/>
14+
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="--logLevel=debug&#10;--port=5007"/>
1515
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.glsp.example.workflow"/>
1616
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
1717
</launchConfiguration>

plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/utils/LaunchUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public final class LaunchUtil {
4848
private LaunchUtil() {}
4949

5050
public static final class DefaultOptions {
51-
public static final int SERVER_PORT = 5007;
51+
public static final int SERVER_PORT = 0;
5252
public static final Level LOG_LEVEL = Level.INFO;
5353
public static final String LOG_DIR = new File("./logs/").getAbsolutePath();
5454
public static final boolean CONSOLE_LOG_ENABLED = true;

0 commit comments

Comments
 (0)