raisedragon / pircbotx

Automatically exported from code.google.com/p/pircbotx
0 stars 0 forks source link

proxy support fails with squid proxy #156

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
- deploy a squid proxy server, with IRC connect allowed (port 6667) on a host 
'H' with port 'P'
- set a ProxySocketFactory in PircBotX using 'H':'P' proxy settings

What is the expected output? What do you see instead?
- correct connection to IRC server through specified proxy
- instead, I get the following exception :

----------------------------------------------------------------
2013-12-10 15:35:50,845 | ERROR | Bot exited with Exception | 
org.pircbotx.MultiBotManager$BotFutureCallback | botPool0-bot0
java.io.IOException: Unable to connect to the IRC network irc.worldnet.net 
(last connection attempt exception attached)
        at org.pircbotx.PircBotX.connect(PircBotX.java:206)
        at org.pircbotx.MultiBotManager$BotRunner.call(MultiBotManager.java:218)
        at org.pircbotx.MultiBotManager$BotRunner.call(MultiBotManager.java:211)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.IllegalArgumentException: Invalid Proxy
        at java.net.Socket.<init>(Socket.java:147)
        at org.pircbotx.ProxySocketFactory.createSocket(ProxySocketFactory.java:78)
        at org.pircbotx.PircBotX.connect(PircBotX.java:194)
        ... 7 more
----------------------------------------------------------------

What version of the product are you using? On what operating system?
- I'm using PircBotX on Ubuntu Server 12.04 (amd64),  Squid is installed on 
another host (CentOS 6), and here is the JDK version :

java version "1.7.0_25"
OpenJDK Runtime Environment (IcedTea 2.3.10) (7u25-2.3.10-1ubuntu0.12.04.2)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)

Please provide any additional information below.

Sounds like a bug in Java socket, since regular clients like Quassel IRC, 
X-Chat, or Konversation can connect without issues through proxy

Original issue reported on code.google.com by guil...@gmail.com on 10 Dec 2013 at 2:52

GoogleCodeExporter commented 9 years ago
Can you post the source of your config? Sounds like you might be missing an 
option in Proxy constructor.

Original comment by Lord.Qua...@gmail.com on 10 Dec 2013 at 3:04

GoogleCodeExporter commented 9 years ago
Wow, fast reply :)

Sure, I've attached you a small sample that contains the whole configuration 
process.

Thanks a lot !

By the way, I came across this.... maybe this is simply why it doesn't work :
http://bugs.sun.com/view_bug.do?bug_id=6370908

Best regards,
Guillaume.

Original comment by guil...@gmail.com on 10 Dec 2013 at 3:12

Attachments:

GoogleCodeExporter commented 9 years ago
If I read well the bug report, we must wait for JDK8 to be released to this old 
bug patched... 

Meanwhile, I'll try to import theses patches into my code to have a 'hacked' 
proxy.
Maybe this would be interesting to see it patched in PircBotX otherwise ?

Regards,
Guillaume.

Original comment by guil...@gmail.com on 10 Dec 2013 at 3:32

GoogleCodeExporter commented 9 years ago
Tested successfully JDK 1.8.0_25 with an HTTP proxy, failed on JDK 1.7.0_67. 
This really isn't a PircBotX issue and the code that actually implements HTTP 
proxy support is huge: http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/48b7295f02f8

Going to go ahead and close this

Original comment by Lord.Qua...@gmail.com on 6 Nov 2014 at 12:50