WEBVTT

00:00.170 --> 00:05.000
Using a proxy inside of request is actually pretty easy.

00:05.030 --> 00:10.390
You seem to need to have a default after you use the require.

00:10.400 --> 00:18.500
So you say dot defaults and then you pass in curly braces and in here you can pass in a property that

00:18.500 --> 00:20.030
is called proxy.

00:20.330 --> 00:26.930
And in here you can paste in the IP and the port of the proxy.

00:27.230 --> 00:30.770
However, I don't have much luck with it.

00:30.770 --> 00:39.620
So by that I mean finding a proxy that you can use from the Internet because most of the free proxies

00:39.620 --> 00:45.440
that you find they are, well, not that good.

00:46.100 --> 00:47.930
So let's take this one.

00:47.930 --> 00:56.100
It has a last check of two minutes and let's take this one with a lower speed or better speed.

00:56.120 --> 00:57.410
So this one.

00:57.920 --> 00:59.150
So that's the IP.

00:59.690 --> 01:01.140
And then let's.

01:02.080 --> 01:03.820
Take that and then the port.

01:03.820 --> 01:09.550
3128 and let's see if it can actually get the file here.

01:11.440 --> 01:16.210
So here we see a tunneling circuit could not be established.

01:16.750 --> 01:19.200
Host Unreachable error.

01:19.210 --> 01:26.490
That's sort of what the kind of error that I'm always getting when I'm trying to use a proxy in NodeJS

01:26.500 --> 01:29.710
request with the free proxies.

01:29.980 --> 01:37.810
Now there's also paid services, so you can buy proxy list, but I haven't used that myself.

01:39.070 --> 01:43.780
And so you can try that if you have to use proxies for some reason.

01:44.200 --> 01:52.030
However, um, I'm going to present you with better alternatives, I hope then using a proxy.

01:52.510 --> 01:58.840
And basically if you're getting blocked from a site, it means that you have done something that makes

01:58.840 --> 01:59.920
them want to block you.

01:59.950 --> 02:07.360
You've been scraping too aggressively perhaps, and you need to tone it down a bit and not scrape so

02:07.360 --> 02:11.390
fast or so, so much in so little time.

02:11.390 --> 02:11.570
Um.
