Skip to content

Commit dff7e13

Browse files
author
tim.besard
committed
Some additions.
1 parent ccbdd38 commit dff7e13

File tree

4 files changed

+39
-3
lines changed

4 files changed

+39
-3
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2009-08-03 Tim Besard <tim-dot-besard-at-gmail-dot-com>
2+
3+
* proxy: more work on the proxy manager.
4+
5+
16
2009-08-09 Přemek Vyhnal <premysl.vyhnal gmail com>
27

38
* plugins: zSHARE added

proxies

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Sample proxy list for slimrat
2+
#
3+
# Should reside in ~/.slimrat/proxies when relying on automatic loading.
4+
5+
# The full proxy specification consists out of two parts:
6+
# - the URI
7+
# - the protocol specification
8+
http://a.b.c.d:1234 http,ftp
9+
10+
# When the protocols are omitted, by default the "http" protocol is used
11+
http://a.b.c.d:1234
12+
13+
# Similarly, when not specifying the type of proxy in the URI, slimrat
14+
# will use it as an HTTP proxy
15+
a.b.c.d:1234 http,ftp
16+
17+
# SOCKS is supported too (in combination with e.g. TOR), but needs
18+
# the cpan module LWP::Protocol::socks
19+
socks://localhost:9050 http,https
20+

queue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Sample queue file for slimrat
2+
#
3+
# This file contains URLs to be loaded by command line parameter using the
4+
# slimrat CLI client.
5+
6+
# An entry consists out of a single part: the URL
7+
http://my-download.site.com/download/file_1.tar
8+

src/Proxy.pm

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,12 @@ sub file_read() {
206206
next if /^\s*$/; # Skip blank lines
207207

208208
# Process a valid proxy
209-
if ($_ =~ m/^\s*(\S+)\t(\S+)\s*/) {
210-
my $link = $1;
211-
my $protocols_string = $2;
209+
if ($_ =~ m/^\s*(\S+)\t*(\S*)\s*/) {
210+
my $link = $1;
211+
my $protocols_string = $2 || "http";
212+
if ($link !~ m/^\S+:\/\//) {
213+
$link = 'http://' . $link;
214+
}
212215
my @protocols = [split(/,/, $protocols_string)];
213216

214217
my $proxy = ProxyData->new();

0 commit comments

Comments
 (0)