Closed Bug 105335 Opened 23 years ago Closed 23 years ago

PAC: SOCKS directive ignored

Categories

(Core :: Networking, defect)

defect
Not set
major

Tracking

()

VERIFIED FIXED

People

(Reporter: benc, Assigned: tingley)

References

()

Details

(Keywords: testcase)

Attachments

(1 file, 8 obsolete files)

bbaetz says this has been broken for some time, but I haven't bothered to write
a bug until now:

STEPS:
On just about any post 0.9.0 version of mozilla, PAC directives "DIRECT" and
"PROXY" worked, but "SOCKS" never has.
Severity: normal → major
Keywords: nsenterprise
QA Contact: benc → pacqa
It not broken, it was just never checked in, because PAC was done before socks4
support was.

Its about 5 lines of code arround line 88 of nsProxyAutoConfig.js - basic, do
you want this?

Don't forget bug 78176.
PAC
Assignee: neeti → serge
Attached patch patch (not tested) (obsolete) — Splinter Review
Attachment #54125 - Attachment is obsolete: true
Blocks: 98821
Comment on attachment 54129 [details] [diff] [review]
patch (updated version of attachment 54125 [details] [diff] [review])


>-            // TODO warn about SOCKS
>+            // we ignore everything else past the first proxy.
>+            // we could theoretically check isResolvable now and continue
>+            // parsing (see bug 84798). but for now...
>+            var hostport = /^(.....) ([^:]+)(:\d+)?/(proxy);

I'd prefer something which just grabbed the first word, rather than expecting 5 characters.

You should do some sort of error handling if you get an unparsable string, right? Or do we just use DIRECT?
Attachment #54129 - Flags: needs-work+
currently we just do DIRECT (by not passing a type back). What sort of error
handling do you expect? A javascript error/warning/message?
Attached patch patch (obsolete) — Splinter Review
Attachment #54129 - Attachment is obsolete: true
Keywords: patch, review
Blocks: 79893
silly me, forgot to '+' the '\w'
Attachment #54109 - Attachment is obsolete: true
Attachment #54892 - Attachment is obsolete: true
improved the regexp a bit, made proxy type matching case insesitive and made
sure that we really ignore everything else past the first proxy.
Attachment #60129 - Attachment is obsolete: true
tingley: mind taking another look?
Attachment #61024 - Attachment is obsolete: true
I think this is ready for review

Note that if this is checked in bug 112969 will probably need a new testcase or
something.
Comment on attachment 61242 [details] [diff] [review]
patch (take 5) [includes fix for bug 91630]


>+                   type.value = "http";
>+                }
>+                // besides http proxy all other proxy types need a port number
>+                else if(typehostport[3] != null) {
>+                    port.value = typehostport[3].substr(1);

Are we not defaulting to 1080 for socks?

r=bbaetz in any event - do what ns4 did.
Attachment #61242 - Flags: review+
okay I tested PAC with nn4 and it turns out that SOCKS proxy defaults to port
1080
so here is take 6 (hopefully the last one)
Attachment #61242 - Attachment is obsolete: true
the latest attachment is not a patch :P
Ooooopsssss sorry about that. Here is the patch
Attachment #61413 - Attachment is obsolete: true
Attachment #61492 - Attachment description: 61413: patch (take 6) [includes fix for bug 91630] → patch (take 6) [includes fix for bug 91630] (the real thing)
Comment on attachment 61492 [details] [diff] [review]
patch (take 6) [includes fix for bug 91630] (the real thing)

sr=darin
Attachment #61492 - Flags: superreview+
assigning to tingley to get patch in after trunk opens
Assignee: serge → tingley
Status: NEW → ASSIGNED
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
+verifyme

I've added a sample PAC file. You need to download this file and modify it for
your test environment, b/c the SOCKS server mentioned does not exist anymore.
VERIFIED: linux 2002-04-09-08 (pre branch)

Actually, you only need to map the hostname in your /etc/hosts to make the file
work if you want to try it yourself.

After realizing that Linux uses the TCP option for timestamps, was able to use
snoop on my server to verify the version number is 04.

# snoop -i pac -p 4 -x 66

  4   0.00000 h-10-169-111-116.nscp.aoltw.net -> carbuncle    SOCKS C port=1233 

           0: 0401 0051 3fc9 391d 4d4f 5a00              ...Q?.9.MOZ.

I'll verify the other platforms some other time.
Status: RESOLVED → VERIFIED
QA Contact: pacqa → benc
uh, this didn't work in the 0.9.4 branch right?
Keywords: verifyme
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: