Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't get any responce from https.get on specific https website #78

Closed
AlexBGD opened this issue Jan 17, 2016 · 32 comments
Closed

Doesn't get any responce from https.get on specific https website #78

AlexBGD opened this issue Jan 17, 2016 · 32 comments

Comments

@AlexBGD
Copy link

AlexBGD commented Jan 17, 2016

var https=require('https');
https.get({ host:'www.juvalis.de', path: '/' }, function(res) {
    res.on('data', function(d) {
        console.log('chunk');
    });

    res.on('end', function() {
        console.log('end');
    });
}).on('error', function(e) {
    console.error(e);
}).on('close',function(){
    console.log('close')
});

no errors,no response only close

@Knighton910
Copy link
Contributor

Hey, are you having any luck with this yet?

Are you running

Version 0.12 or 0.10 or newer?

@AlexBGD
Copy link
Author

AlexBGD commented Jan 21, 2016

still have a problem, with curl works fine

v5.4.0

@Knighton910
Copy link
Contributor

var https = require('https');

https.get('https://www.juvalis.de/', function(res) {
console.log("statusCode: ", res.statusCode);
console.log("headers: ", res.headers);

res.on('data', function(d) {
    process.stdout.write(d);
});

}).on('error', function(e) {
console.error(e);
});

I'm doing it with version .12 of node & it's giving me the same.

it's not even logging the string chunk

@AlexBGD
Copy link
Author

AlexBGD commented Jan 21, 2016

I try also with v0.10.25 and don't work. Very strange

@Knighton910
Copy link
Contributor

Are you trying to create a server with this, is this code suppose to be attached to some other code? What exactly are you trying to do? Besides get a response?

@AlexBGD
Copy link
Author

AlexBGD commented Jan 21, 2016

No server, It's scraping app.There are more than 20 shops and all works fine except that one.

@Knighton910
Copy link
Contributor

Bummer, well let's change that & get you back up & running.

@AlexBGD
Copy link
Author

AlexBGD commented Jan 21, 2016

oh yeah

@Knighton910
Copy link
Contributor

Okay so I'm getting a response with this, it may not be what you wanted, but we can inch closer to the end goal with it.

const https = require('https');

https.get('https://juvalis.de/', (res) => {
console.log('statusCode: ', res.statusCode);
console.log('headers: ', res.headers);

res.on('data', (d) => {
process.stdout.write(d);
});

}).on('error', (e) => {
console.error(e);
});

don't worry I'll try to dial it down from es6 once we get the result you want.

So it's giving me a buffer, if i do a buff to string that should be closer to what's expected.

screen shot 2016-01-21 at 1 53 29 pm

screen shot 2016-01-21 at 1 53 51 pm

@Knighton910
Copy link
Contributor

Are you having any luck on your side?

@AlexBGD
Copy link
Author

AlexBGD commented Jan 22, 2016

Still no luck

@SomeoneWeird
Copy link
Member

Are you sitting behind a proxy?

@AlexBGD
Copy link
Author

AlexBGD commented Jan 22, 2016

No

I am not blocked for shure

@Knighton910
Copy link
Contributor

So @AlexBGD from the response i got earlier in that photo, what kind of response are you expecting, how should this code respond?

@AlexBGD
Copy link
Author

AlexBGD commented Jan 23, 2016

So when I remove www from url I get error event(like on your photo) but still don't get any responce, only error event.

with curl all works fine

@Knighton910
Copy link
Contributor

Because your not assigning it a server & specifying a port for it to run on, your not gonna be able to see this in a browser. But we can give it a createServer & port & run it in a browser.

@AlexBGD
Copy link
Author

AlexBGD commented Jan 25, 2016

I don't need a server, it's cli app. I just want to know why I don't get any respoce and how to handle that in the future.

@Knighton910
Copy link
Contributor

check out these two photos.
screen shot 2016-01-25 at 12 03 46 pm

and

screen shot 2016-01-25 at 12 04 15 pm

and then look at these two.
screen shot 2016-01-25 at 12 09 19 pm

screen shot 2016-01-25 at 12 10 14 pm

something is off about that web address. Because there is a response with every other web address except for the one, your trying to make it work with.

@Knighton910
Copy link
Contributor

I would close this now, but i want one of my colleagues to look this over, to make sure i didn't miss anything.

@bnoordhuis
Copy link
Member

node -e 'require("https").get("https://www.juvalis.de/", res => res.pipe(process.stdout));' works fine for me with node master:

$ node -v
v6.0.0-pre

Can you confirm?

@MylesBorins
Copy link

I can confirm that work on master but not v4 or v5

@Knighton910
Copy link
Contributor

👍 Thanks guys for helping out. @thealphanerd & @bnoordhuis

Yeah i have -v 4.2.4
so it's not working for me. I'll try -V 6 and see if it works out.

@bnoordhuis
Copy link
Member

It would be good to figure out what commit fixes it (probably not ALPN support, that exists in v5) and back-port it. I don't have time right now but a simple git bisect should do it.

@MylesBorins
Copy link

I'll give a bisect a run this afternoon. I really hope it isn't a semver major fix

@Knighton910
Copy link
Contributor

Hey what's the result of this running successful, since it works on -v 6 and master, I'm on v4 so i can't tell.
can you someone give me a screen shot or typed result of it. Then I'll start bisecting.

@MylesBorins
Copy link

@kelthenoble the result would be the entire html document. If you see lots of lines in your terminal it is working, if not :(

@Knighton910
Copy link
Contributor

I think i got ya. Ok this is my first time git bisecting, So i'll start, & will let you guys know how it goes.

@MylesBorins
Copy link

@kelthenoble let me know if you want to pair on this. Feel free to ping me in #node-dev

@Knighton910
Copy link
Contributor

yeah, that sounds great, I'm reinstalling git short cuts & ohmyzsh, i factory restarted my mac

I'm down in about 5 mins.

@Knighton910
Copy link
Contributor

@AlexBGD Thanks for your patience as we got to the root of the problem. So in conclusion, there has been issues like this, and the fix was pushed master. But to my understanding, some of the support for other versions will drop in the following weeks. But there is a temp solution: https://nodejs.org/download/nightly/. If you follow some of the references & links, you can look further into it. But for now, my advice is just to wait for a few weeks.

screen shot 2016-01-27 at 10 38 04 am

@AlexBGD
Copy link
Author

AlexBGD commented Jan 27, 2016

Thanks man

@Knighton910
Copy link
Contributor

You're very welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants