I have been looking at TWiki::Net, sub getURL, trying to understand it. (Socket Programming is not my forte). The Company for which I Work has implemented its Intranet under HTTPS and needs to be able to
IncludeUrlWithHttpsProtocol I took a look at sub getURL, then asked my local Perl User Group for suggestions for modifications. The suggestion I got back was "Convert this function to use LWP and go from there".
I had wondered myself... why is TWiki using the Socket module diirectly when LWP was essentially written to handle getting URLs? Is this historical?
Might not converting to LWP bring more willing Perl developers into the TWiki arena?
--
VickiBrown - 15 Nov 2004
I broke your lock, hope I didn't munge anything!
Several modules related to TWiki use LWP already; it's quite straightforward to use.
geturl predates LWP, but it also it hasn't been moved up to using LWP because LWP isn't available by default in perl distributions, and the goal is for
geturl to work on any platform it lands on.
It hard to know what to advise without knowing what you are trying to do, but if you want an example of LWP usage, take a look at
BuildContrib, in the lib/TWiki/Contrib/Build.pm. In there, in
sub target_upload, you will find a
UserAgent that passes authentication data. It may be of some assistance.
--
CrawfordCurrie - 15 Nov 2004
an example of
CPAN:LWP::UserAgent
is at
https://twiki.org/p/pub/Codev/TWikiTestInfrastructure/mechanise-test.pl.txt --
WillNorris - 15 Nov 2004
>
It hard to know what to advise without knowing what you are trying to do I'm trying to implement HTTPS include functionality (
IncludeUrlWithHttpsProtocol)
I don't want an example of LWP usage. I have plenty of those and another wouldn't help in this case. I need the functionality described under
IncludeUrlWithHttpsProtocol. If getURL used LWP I could perhaps add the required HTTPS functionality myself, or so say those who have advised me.
Therefore, as those in my user group seemed to feel that the only logical course of action would be to upgrade the function to use LWP, I asked "why doesn't this function use LWP?" (I was afraid that "it's not part of the Perl base distribution" was going to be the answer. It's not an answer I
accept, but it's the answer I expected).
Unfortunately, as far as my problem relates, there seems to be little I can do but wait and hope for someone on the TWiki team to have both the motivation and tuits to solve the
IncludeUrlWithHttpsProtocol problem for me (and others).
I can't solve it myself given the current coding of getURL and I don't want to rewrite the function only for my site. If I "fixed" it, I'd want to send back the fix. But before I, or anyone e;lse, can "fix" this by using LWP, there must be agreement wiithin the TWiki team to permit use of LWP here. (Thus, this topic). (:-(
Perhaps LWP could be used for https URLs with appropriate caveats in the documentation? After all, even using LWP, HTTPS support requires a few additional Perl modules that are not "part of the standard distribution". In theory, the average site doesn't need HTTPS includes. Perhaps it would be appropriate to document the functionality, e.g. "%INCLUDE% of http URLs is provided "out of the box"; "%INCLUDE% of https URLs requires that you install the following additional Perl modules..."
--
VickiBrown - 18 Nov 2004