This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Clojure and the fly likes Setting a proxy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Languages » Clojure
Bookmark "Setting a proxy" Watch "Setting a proxy" New topic
Author

Setting a proxy

Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

I was trying to use parse-seq from clojure.contrib.lazy-xml but got a "java.net.SocketException: Connection reset". I guess it's because of the proxy. Is there a file where I can set the proxy ? If yes, which and how ?


[My Blog]
All roads lead to JavaRanch
Chris Houser
author
Greenhorn

Joined: Feb 07, 2011
Posts: 22

This is really a Java question and is answered thoroughly in the official documentation.

To set the HTTP proxy from within a Clojure program, you could use this:
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

I see. I was expecting something like a properties file where it could be set, so that I don't need to do it all the time. Like in Maven where I put the proxy setting in settings.xml. Is user.clj the right place ?
Chris Houser
author
Greenhorn

Joined: Feb 07, 2011
Posts: 22

If it works for Java, there's a very good chance it'll work for Clojure. Have you tried using settings.xml?
 
Don't get me started about those stupid light bulbs.
 
subject: Setting a proxy
 
Similar Threads
What is Proxy Object?
Decorator Pattern
Why does "connnection timed out" appear when trying to read remote xml file.
Sockets vs URL Based classes
Another 'Y' game