Skip to content

Commit

Permalink
Merge branch 'release/1.11.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
nwtgck committed Jan 24, 2022
2 parents c965b31 + 1c5a5a0 commit f5b39de
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 65 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)

## [Unreleased]

## [1.11.0] - 2022-01-24
### Changed
* Update dependencies

### Added
* Add --host option to listen on specified address

## [1.10.2] - 2022-01-22
### Fixed
* Change GET action in /noscript page to relative path
Expand Down Expand Up @@ -398,7 +405,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
* Docker automated build on Docker Hub
* Support HTTPS

[Unreleased]: https://github.com/nwtgck/piping-server/compare/v1.10.2...HEAD
[Unreleased]: https://github.com/nwtgck/piping-server/compare/v1.11.0...HEAD
[1.11.0]: https://github.com/nwtgck/piping-server/compare/v1.10.2...v1.11.0
[1.10.2]: https://github.com/nwtgck/piping-server/compare/v1.10.1...v1.10.2
[1.10.1]: https://github.com/nwtgck/piping-server/compare/v1.10.0...v1.10.1
[1.10.0]: https://github.com/nwtgck/piping-server/compare/v1.9.1...v1.10.0
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ docker run -p 8080:8080 -d --restart=always nwtgck/piping-server
Run a Piping Server on <http://localhost:8080> as follows on Linux.

```bash
curl -L https://github.com/nwtgck/piping-server-pkg/releases/download/v1.10.0/piping-server-pkg-linuxstatic-x64.tar.gz | tar xzvf -
curl -L https://github.com/nwtgck/piping-server-pkg/releases/download/v1.10.2/piping-server-pkg-linuxstatic-x64.tar.gz | tar xzvf -
./piping-server-pkg-linuxstatic-x64/piping-server --http-port=8080
```
The binaries are for multi-platform including Linux on x64, Linux on ARM64, Linux on ARMv7, Intel macOS, Apple Silicon macOS and Windows on x64. See <https://github.com/nwtgck/piping-server-pkg> to run on the other platform.
Expand Down Expand Up @@ -163,6 +163,7 @@ Here is available CLI options by `piping-server --help`.
Options:
--help Show help [boolean]
--version Show version number [boolean]
--host Bind address (e.g. 127.0.0.1, ::1) [string]
--http-port Port of HTTP server [default: 8080]
--enable-https Enable HTTPS [boolean] [default: false]
--https-port Port of HTTPS server [number]
Expand Down
99 changes: 41 additions & 58 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "piping-server",
"version": "1.10.2",
"version": "1.11.0",
"description": "Streaming Data Transfer Server over HTTP/HTTPS",
"bin": {
"piping-server": "dist/src/index.js"
Expand Down Expand Up @@ -39,7 +39,7 @@
"@types/yargs": "^17.0.8",
"espower-typescript": "^10.0.0",
"get-port": "^5.1.1",
"mocha": "^9.1.3",
"mocha": "^9.2.0",
"power-assert": "^1.6.1",
"request": "^2.88.2",
"then-request": "^6.0.2",
Expand Down
9 changes: 7 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import {VERSION} from "./version";

// Create option parser
const parser = yargs
.option("host", {
describe: "Bind address (e.g. 127.0.0.1, ::1)",
type: "string",
})
.option("http-port", {
describe: "Port of HTTP server",
default: 8080
Expand All @@ -37,6 +41,7 @@ const parser = yargs

// Parse arguments
const args = parser.parseSync(process.argv.slice(2));
const host: string | undefined = args["host"];
const httpPort: number = args["http-port"];
const enableHttps: boolean = args["enable-https"];
const httpsPort: number | undefined = args["https-port"];
Expand All @@ -53,7 +58,7 @@ const pipingServer = new piping.Server({ logger });
logger.info(`Piping Server ${VERSION}`);

http.createServer(pipingServer.generateHandler(false))
.listen(httpPort, () => {
.listen({ host, port: httpPort }, () => {
logger.info(`Listen HTTP on ${httpPort}...`);
});

Expand Down Expand Up @@ -85,7 +90,7 @@ if (enableHttps && httpsPort !== undefined) {
allowHTTP1: true
},
pipingServer.generateHandler(true)
).listen(httpsPort, () => {
).listen({ host, port: httpsPort }, () => {
logger.info(`Listen HTTPS on ${httpsPort}...`);
});
}
Expand Down
3 changes: 2 additions & 1 deletion tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"no-empty": false,
"class-name": false,
"max-classes-per-file": false,
"variable-name": false
"variable-name": false,
"no-string-literal": false
},
"rulesDirectory": []
}

0 comments on commit f5b39de

Please sign in to comment.