Skip to content

Commit dc6b980

Browse files
authored
feat: adjust server startup to use autoassigned ports (#42)
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 <[email protected]>
1 parent 5c40594 commit dc6b980

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

.vscode/launch.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"request": "launch",
6767
"name": "Debug Workflow Example Server",
6868
"program": "${workspaceFolder}/examples/workflow-server/bundle/wf-glsp-server-node.js",
69+
"args": ["--port", "5007"],
6970
"env": {
7071
"NODE_ENV": "development"
7172
},

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
- Refactored `CreateOperationHandler` to an interface instead of a class
2828
- Renamed the services and handlers of the direct GModel library => consistent use of `GModel` prefix
2929
- The `ModelState` interface no longer has an `isDirty` flag. Dirty state is now handled by the `CommandStack`
30+
- [server] Default port has changed from 5007 (and 8081 for websocket) to 0, which implies autoassignment by the OS [#42](https://github.com/eclipse-glsp/glsp-server-node/pull/42)
3031

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

examples/workflow-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"lint": "eslint --ext .ts,.tsx ./src",
5050
"lint:ci": "yarn lint -o eslint.xml -f checkstyle",
5151
"prepare": "yarn clean && yarn build",
52-
"start": "node --enable-source-maps bundle/wf-glsp-server-node.js",
52+
"start": "node --enable-source-maps bundle/wf-glsp-server-node.js --port 5007",
5353
"start:websocket": "node --enable-source-maps bundle/wf-glsp-server-node.js -w --port 8081",
5454
"watch": "tsc -w"
5555
},

packages/server/src/node/launch/socket-cli-parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export interface SocketLaunchOptions extends LaunchOptions {
2323

2424
export const defaultSocketLaunchOptions: Required<SocketLaunchOptions> = {
2525
...defaultLaunchOptions,
26-
port: 5007,
26+
port: 0,
2727
host: 'localhost'
2828
};
2929

0 commit comments

Comments
 (0)