logo
down
shadow

Java app behind proxy to use http_proxy variable in linux


Java app behind proxy to use http_proxy variable in linux

By : Ryan McGough
Date : October 28 2020, 08:00 PM
around this issue I am thinking of a simple Java appplication (command line) that connects to the internet to download a XML file, the problem is that my Ubuntu is using a proxy to connect to internet with username and password (through http_proxy ="http://:@:" ). So my question is, could it be possible to write a java app to use http_proxy variable? Instead of programmatically setting http proxy and host in every app I will write. , Don't forget the shell variable _JAVA_OPTIONS
code :


Share : facebook icon twitter icon
How to safely use http_proxy variable in linux

How to safely use http_proxy variable in linux


By : 李伯爵
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , I got complicated about http_proxy on our linux server. The thing is that we use to go through our proxy, which is preferenced on ldap, so I must use my machine's login and password in http_proxy to be able to download something from the ssh client. I can edit bash_profile with that, I can use alias for curl like curlp where I could set proxy login and proxy password. , Try this one:
Create an encrypted password of your password:
code :
openssl enc -aes-256-cbc -in mypassword.txt -out mypassword.bin
alias myproxy='PASSWORD=`openssl aes-256-cbc -d -in mypassword.bin`; PROXY="http://$USER:$PASSWORD@proxy:$PORT"; export http_proxy=$PROXY; export https_proxy=$PROXY; export ftp_proxy=$PROXY'
why http_proxy,https_proxy,all_proxy env didn't work For me when i use git proxy?

why http_proxy,https_proxy,all_proxy env didn't work For me when i use git proxy?


By : Matthew Bowlan
Date : March 29 2020, 07:55 AM
wish help you to fix your issue Either because you set the env to domain.com:8888 and did not specify a port in the git config, or because you need to uppercase those env vars.
Also you do realize, that you can set git vars per repo? So you could do:
code :
git init myrepo
cd myrepo
git config http.proxy "domain.com"
git remote add origin myremote
git fetch --all
git checkout -B master origin/master
Using Ruby with Charles Proxy via export http_proxy on Mac

Using Ruby with Charles Proxy via export http_proxy on Mac


By : Johannes
Date : March 29 2020, 07:55 AM
Any of those help The http_proxy environment variable should include the protocol as well. Curl seems to be lazy in that sense.
Try setting the proxy via
Does http_proxy automatically work in Linux for all applications?

Does http_proxy automatically work in Linux for all applications?


By : user3586381
Date : March 29 2020, 07:55 AM
will help you
Is this because curl looks up http_proxy and setup proxy internally in the source code or it just automatically works?
How to set proxy settings (http_proxy variables) for kubernetes (v1.11.2) cluster?

How to set proxy settings (http_proxy variables) for kubernetes (v1.11.2) cluster?


By : LittleG
Date : March 29 2020, 07:55 AM
will be helpful for those in need So I figured it out that to set the proxy for particular containers, set the env variable in Dockerfile.
code :
ENV HTTP_PROXY http://10.x.x.x:PORT
Related Posts Related Posts :
  • Java - JPA - Generators - @SequenceGenerator
  • What's a good Java-based Master-Slave communication mechanism?
  • Design Help/Suggestion required
  • NullPointerException in com.sun.tools.jxc.SchemaGenTask
  • time required to finish the multithreaded program?
  • Traditional IO vs memory-mapped
  • Using StringBuilder to process csv files to save heap space
  • Response Time is different for mulitiple execution of the application with the same request Performance problem
  • Java - Weblogic - JMX : request available free memory on all servers
  • Error: Can't find common super class of
  • JNI problem when calling a native library that loads another native library
  • calling Stanford POS Tagger maxentTagger from java program
  • Notification framework for java
  • hide keyboard in android?
  • Alternative of JPA
  • How to get Java XP Look and Feel
  • Remote JMS connection still using localhost
  • Java NoClassDefFoundError
  • Is O(N!*N) an acceptable big oh complexity class or do I remove the constant and just say O(N!)?
  • Java File URI error?
  • Using an interface as a constructor parameter in Java?
  • Add additional path to exec-maven-plugin
  • Natural Language parsing of an appointment?
  • Java: How to tell which fontconfig file my system is currently using?
  • How to create notification icon badge on Android apps (like iPhone)
  • Interfaces with hibernate annotations
  • Getting ConnectionTimeoutException with the host did not accept the connection within timeout
  • How to get all property names of a Groovy class?
  • Java Netscape LDAP Remove One Attribute
  • A simple two column layout with Swing
  • Making a Linked list using Generics
  • how to handle result set data
  • Cloning java ArrayList and preventing it from modifications
  • Java How to call method of grand parents?
  • running jython bytecode using java
  • get content from website with utf8 format
  • Sendgrid v3: "Substitutions may not be used with dynamic templating"
  • Application freezes when running method
  • Maven versioning using git branches
  • does a Java getter incur a performance penalty
  • Open Source Implementation of Checkers
  • How can I make a resizable array in Java?
  • Change size of ImageIcon in a JRadioButton
  • Java memory mapped files and swap
  • JAXB Annotated class - setting of a variable which is not an element
  • JSF don't find component in view root with the form id
  • Using Mockito, how do I match against the key-value pair of a map?
  • How do I run my application as superuser from Eclipse?
  • Spring-Security: Call method after authentication
  • How can I add a password to this JDBC:ODBC connection string that is trying to connect to an MS Access database
  • java.sql.SQLException: database locked
  • Json Jackson deserialization without inner classes
  • Error starting modern compiler
  • Generate a random number in interval [0,360) which is divisible by number 15
  • Rotate watermark text at 45 degree angle across the center Apache PDFBox
  • Generate Random number in a range with no repeatation
  • Starting HBASE, java.lang.ClassNotFoundException: org.apache.htrace.SamplerBuilder
  • Using getter and setter methods inside a class in my main class
  • java: <identifier> expected with ArrayList
  • Java Reflection, java.lang.IllegalAccessException Error
  • shadow
    Privacy Policy - Terms - Contact Us © 35dp-dentalpractice.co.uk