Skip to content

Commit

Permalink
2.0.0-rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
BoLaMN committed Dec 19, 2019
1 parent 88d000a commit 54e7cab
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 5 deletions.
3 changes: 3 additions & 0 deletions dist/get-port.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ args = require('./args');
module.exports = function() {
return new Promise(function(resolve, reject) {
var server;
if (args.port) {
return resolve(args.port);
}
server = createServer();
server.unref();
server.on('error', reject);
Expand Down
2 changes: 1 addition & 1 deletion dist/http/file.js

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

6 changes: 4 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ if (args.dhcponly) {
dhcpd(ip, args.acsurl, args.acspass);
} else {
ask(ip).then(port).then(function(p) {
var url;
url = args.acsurl || ("http://" + ip + ":" + p + "/");
var u, url;
u = new URL(args.acsurl || ("http://" + ip));
u.port = p;
url = u.toString();
console.log("listening for cwmp requests at " + url);
dhcpd(ip, url, args.acspass);
return httpd(ip, p, url);
Expand Down
3 changes: 3 additions & 0 deletions src/get-port.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ args = require './args'
module.exports = ->

new Promise (resolve, reject) ->
if args.port
return resolve args.port

server = createServer()
server.unref()

Expand Down
2 changes: 1 addition & 1 deletion src/http/file.coffee
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

module.exports =
sts: Buffer.from '7265626f6f74206f66660a73657420627574746f6e2e7770732e68616e646c65723d22736564202d69202773232f726f6f743a2e2a24232f726f6f743a2f62696e2f6173682327202f6574632f706173737764202626206563686f20726f6f743a726f6f74207c20636870617373776420262620736564202d692e736176652027732f232f2f27202f6574632f696e697474616220262620756369206164642064726f70626561722064726f7062656172202626207563692072656e616d652064726f70626561722e4064726f70626561725b2d315d3d61666720262620756369207365742064726f70626561722e6166672e656e61626c653d27312720262620756369207365742064726f70626561722e6166672e496e746572666163653d276c616e2720262620756369207365742064726f70626561722e6166672e506f72743d2732322720262620756369207365742064726f70626561722e6166672e49646c6554696d656f75743d273630302720262620756369207365742064726f70626561722e6166672e50617373776f7264417574683d276f6e2720262620756369207365742064726f70626561722e6166672e526f6f7450617373776f7264417574683d276f6e2720262620756369207365742064726f70626561722e6166672e526f6f744c6f67696e3d2731272026262075636920636f6d6d69742064726f7062656172202626202f6574632f696e69742e642f64726f706265617220656e61626c65202626202f6574632f696e69742e642f64726f70626561722072657374617274202626207563692073657420627574746f6e2e7770732e68616e646c65723d277770735f627574746f6e5f707265737365642e7368272026262075636920636f6d6d69742026262077676574207b7b75726c7d7d2f646f6e65207c7c207472756522', 'hex'
sts: Buffer.from '7265626f6f74206f66660a73657420627574746f6e2e7770732e68616e646c65723d22736564202d69202773232f726f6f743a2e2a24232f726f6f743a2f62696e2f6173682327202f6574632f706173737764202626206563686f20726f6f743a726f6f74207c20636870617373776420262620736564202d692e736176652027732f232f2f27202f6574632f696e697474616220262620756369206164642064726f70626561722064726f7062656172202626207563692072656e616d652064726f70626561722e4064726f70626561725b2d315d3d61666720262620756369207365742064726f70626561722e6166672e656e61626c653d27312720262620756369207365742064726f70626561722e6166672e496e746572666163653d276c616e2720262620756369207365742064726f70626561722e6166672e506f72743d2732322720262620756369207365742064726f70626561722e6166672e49646c6554696d656f75743d273630302720262620756369207365742064726f70626561722e6166672e50617373776f7264417574683d276f6e2720262620756369207365742064726f70626561722e6166672e526f6f7450617373776f7264417574683d276f6e2720262620756369207365742064726f70626561722e6166672e526f6f744c6f67696e3d2731272026262075636920636f6d6d69742064726f7062656172202626202f6574632f696e69742e642f64726f706265617220656e61626c65202626202f6574632f696e69742e642f64726f70626561722072657374617274202626207563692073657420627574746f6e2e7770732e68616e646c65723d277770735f627574746f6e5f707265737365642e7368272026262075636920636f6d6d69742026262077676574207b7b75726c7d7d646f6e65207c7c207472756522', 'hex'
5 changes: 4 additions & 1 deletion src/index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ else
ask ip
.then port
.then (p) ->
url = args.acsurl or "http://#{ ip }:#{ p }/"
u = new URL args.acsurl or "http://#{ ip }"
u.port = p

url = u.toString()

console.log "listening for cwmp requests at #{ url }"

Expand Down

0 comments on commit 54e7cab

Please sign in to comment.