[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How Do I Set Up Proxy Server?
hi Mike,
>
> I started with example 1 but timed out.
>
This doesn't sound like you need to set up a proxy -- it sounds like you
need to _use_ your corporate proxy.
In other words, your site's firewall doesn't allow direct outgoing
connections to web servers, instead you need to connect through a proxy
to get to any web servers.
Is that right?
> Our network people told me I have to set u a proxy server on the
> iSeries in order to get outside to the URL in that example. I'm not a
> network person and I can't make sense of all the material identified
> by Google.
Okay. I'll explain... some networks don't allow you to directly
access the world wide web. Instead, they force you to use a proxy
server that they've set up for you.
The idea is that none of the computers on the network are allowed access
to the web, except the proxy server. All requests go through the proxy
server.
The browser (or HTTPAPI) connects to the proxy server and tells the
proxy the URI of the data it needs. The proxy then goes out to the
internet and fetches the document, and then relays that document back to
the browser (or HTTPAPI).
Why would you want to use one if all it does is fetch the same document
that you could've fetched yourself? Well, there are several reasons.
1) One reason is that a proxy can cache the response. So if you have
100 people on your network all sharing the same proxy and going to the
same sites, they don't all have to download everything. Instead, the
proxy's cache can provide stuff locally, speeding up load times and
reducing the company's overall bandwidth requirement.
2) It can be used to check for viruses and other harmful materials. As
the data comes back, a proxy server can scan it for
viruses/malware/spyware, etc.
3) IT can be used to control access. Some folks on your network might
be restricted to certain sites. Others might have full access to
anything. Or perhaps there are certain sites (such as pornography,
games, etc) that your network wishes to block.
So lots of folks have proxies on their network. In order to access the
web pages that are outside the network, they must go through the proxy.
That would explain why you're getting a timeout error -- your company
has blocked access.
However, setting up a proxy on your IBM i wouldn't help solve that.
Your IBM i obviously is already blocked from the web, so a proxy on the
i, and a HTTPAPI on the same i would have the same problem. Instead,
your network administrator needs to set up a proxy device that _is_
allowed access to the web, and block everything else.
And I suspect that's what your net admin was trying to say -- that you
have to use a proxy -- his proxy that he already has set up.
To use it with HTTPAPI, you'll need to know the host name (or IP
address) and port number for the proxy. And you'll also need to know
whether a userid/password is required or not, and if one is required
you'll need to know what they are.
>
> Can someone point me to one or two hands-on guides that might enable
> me to run Scott's examples?
>
To use a proxy from HTTPAPI, you need to add code to the example
programs (or your own programs). Before doing any "get" or "post"
requests, you neeed something like this:
/free
http_setproxy('myproxy.example.com': 1234);
where 'myproxy.example.com' is replaced with the host name (or IP
address) of your proxy server, and 1234 is replaced with the port number.
Additionally, if you need to use a userid/password with your proxy,
you'll need something like this:
http_proxy_setauth( HTTP_AUTH_BASIC
: 'youruserid'
: 'yourpassword' );
Once you've set them, they will be remembered til the activation group
is reclaimed... thereafter you can run HTTP requests, and HTTPAPI will
connect through the proxy.
Good luck
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------