Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function afterConfigLoad() {
logger.logger.warn({
addr: ( addr.path
? URL.format({
protocol: 'unix',
protocol: addr.proto || 'unix',
pathname: addr.path,
})
: URL.format({
Expand Down
9 changes: 9 additions & 0 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,15 @@ module.exports.parse_address = function parse_address(addr) {
path: m[4],
}

// Windows named pipe
// \\ . \pipe\ (PipeName)
var m = /^\\\\\.\\pipe\\[^\\]+$/.exec(addr)

if (m) return {
proto: 'winpipe',
path: addr
}

return null
}

Expand Down
5 changes: 5 additions & 0 deletions test/unit/listen_addr.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,9 @@ describe('Parse address', function() {
addTest('blah://4873', null)
addTest('https://blah:4873///', null)
addTest('unix:1234', 'http', 'unix', '1234') // not unix socket

addTest('\\\\.\\pipe\\01a96932-567e-41e8-9bed-0eba99ec769b', 'winpipe','\\\\.\\pipe\\01a96932-567e-41e8-9bed-0eba99ec769b')
addTest('\\\\.\\pipe', null)
addTest('\\\\.\\pipe\\', null)
addTest('\\\\.\\pipe\\foo\\bar', null)
})