Skip to content

Commit

Permalink
Bump actionhero from 27.2.0 to 28.0.0 (#163)
Browse files Browse the repository at this point in the history
* Bump actionhero from 27.2.0 to 28.0.0

Bumps [actionhero](https://github.com/actionhero/actionhero) from 27.2.0 to 28.0.0.
- [Release notes](https://github.com/actionhero/actionhero/releases)
- [Commits](actionhero/actionhero@v27.2.0...v28.0.0)

---
updated-dependencies:
- dependency-name: actionhero
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* Actionhero v28

* remove action test

* readme

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Evan Tahler <[email protected]>
  • Loading branch information
dependabot[bot] and evantahler authored Dec 1, 2021
1 parent 8d0bc46 commit 048f535
Show file tree
Hide file tree
Showing 18 changed files with 885 additions and 199 deletions.
50 changes: 29 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

As of Actionhero v21, the socket server is not included with Actionhero by default. You can add it (this package) via `npm install actionhero-socket-server`.

As of version `3.0.0` of this package, Actionhero v28+ is required.

```shell
❯ telnet localhost 5000
Trying 127.0.0.1...
Expand All @@ -20,7 +22,7 @@ Connection closed by foreign host.
## Installation

1. Add the package to your actionhero project: `npm install actionhero-socket-server --save`
2. Copy the config file into your project `cp ./node_modules/actionhero-socket-server/src/config/servers/socket.ts src/config/servers/socket.ts`
2. Copy the config file into your project `cp ./node_modules/actionhero-socket-server/src/config/socket.ts src/config/socket.ts`
3. Enable the plugin:

```ts
Expand Down Expand Up @@ -64,27 +66,33 @@ socket: error => {
All options are exposed via the config file:

```ts
const namespace = "socket";

declare module "actionhero" {
export interface ActionheroConfigInterface {
[namespace]: ReturnType<typeof DEFAULT[typeof namespace]>;
}
}

export const DEFAULT = {
servers: {
socket: (config) => {
return {
enabled: true,
// TCP or TLS?
secure: false,
// Passed to tls.createServer if secure=true. Should contain SSL certificates
serverOptions: {},
// Port or Socket
port: 5000,
// Which IP to listen on (use 0.0.0.0 for all)
bindIP: "0.0.0.0",
// Enable TCP KeepAlive pings on each connection?
setKeepAlive: false,
// Delimiter string for incoming messages
delimiter: "\n",
// Maximum incoming message string length in Bytes (use 0 for Infinite)
maxDataLength: 0,
};
},
[namespace]: () => {
return {
enabled: true,
// TCP or TLS?
secure: false,
// Passed to tls.createServer if secure=true. Should contain SSL certificates
serverOptions: {},
// Port or Socket
port: 5000,
// Which IP to listen on (use 0.0.0.0 for all)
bindIP: "0.0.0.0",
// Enable TCP KeepAlive pings on each connection?
setKeepAlive: false,
// Delimiter string for incoming messages
delimiter: "\n",
// Maximum incoming message string length in Bytes (use 0 for Infinite)
maxDataLength: 0,
};
},
};
```
2 changes: 1 addition & 1 deletion __tests__/servers/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const makeSocketRequest = async (

const buildClient = (): any => {
return new Promise((resolve) => {
const conn = net.connect(config.servers.socket.port);
const conn = net.connect(config.socket.port?.toString());
// conn.data = "";
conn.on("connect", () => {
conn.setEncoding("utf8");
Expand Down
Loading

0 comments on commit 048f535

Please sign in to comment.