The a@hef returned does not contain a port as part of the link.
Describe your issue here.
I ran a scraper for a locally hosted website, on a particular port , and I tried to scrape the a@href for the link, the link will come back as localhost/<page>.html instead of localhost:5838/<page>.html
Your environment
version of node: 7.5.0
version of npm: 3.10.5
xray: 2.2.1
Steps to reproduce
Tell us how to reproduce this issue.
Host a very simple file with a a@href tag locally, do a simple xray command on it, and no port will be returned as part of that link
Expected behaviour
Expected the port to be part of the a@hef or maybe some documentation on a workaround.
Actual behaviour
Link is wrong when using localhost.
Purposed Code Changes
I'm not sure if it's justified to put in a port, and I'm not sure what damage it'll cause, but I was mucking with the code a little bit, and I found that if I simply append the port in the absolutes.js file, and simply do something like this...
function absolute (path, $) {
var parts = url.parse(path)
- var remote = parts.protocol + '//' + parts.hostname
+ var remote = parts.protocol + '//' + parts.hostname + ':' + parts.port;
^ this will work for me, but it seems arrogant for me to assume that it won't break anything else.
Subject of the issue
The a@hef returned does not contain a port as part of the link.
Describe your issue here. I ran a scraper for a locally hosted website, on a particular port, and I tried to scrape the a@href for the link, the link will come back as
localhost/<page>.html
instead oflocalhost:5838/<page>.html
Your environment
Steps to reproduce
Tell us how to reproduce this issue.
Expected behaviour
Actual behaviour
Purposed Code Changes
I'm not sure if it's justified to put in a port, and I'm not sure what damage it'll cause, but I was mucking with the code a little bit, and I found that if I simply append the port in the
absolutes.js
file, and simply do something like this...^ this will work for me, but it seems arrogant for me to assume that it won't break anything else.