Web-service detects when connecting through a proxy server - java

I'm trying to connect to a website via Java code and it works.
When I route my code to connect via a proxy server - it seems to detect it and return an error page.
I'm using AWS proxy server (tinyproxy).
Any way around it?


Microsoft Bot Framework - Building and debugging a client locally using ngrok

I've built a simple bot using the Microsoft Bot Framework. I now want to build a client to embed in my Mobile App. When using the Direct Line API to send a message to my bot I get a 500 error which doesn't occur through other channels.
To debug this I am attempting to run the bot on localhost and expose the port using ngrok so it can be accessed by the Direct Line API. The bot runs fine locally and processes requests fine when they are made to localhost. However when the same request is made to the temporary url created by ngrok when exposing the port, I get a 400 Bad Request error.
Has anyone run in to this problem or have some advice on how to solve it?
I've solved this now. Apparently the bot doesn't like it when the host header is not as expected. To solve this I exposed the port using the following ngrok command:
ngrok http [port] -host-header="localhost:[port]"
Where [port] is the port that the bot is running on.

Java how to tunnel SSL Proxy

I am trying to make an Proxy Server.
I want to tunnel an https connection for example the client tries to connect to https://google.com trough the Proxy, then the Proxy gets the Command to CONNECT.
I want to know how to tunnel this connection.
So that I can reach https://google.com through my Proxy Server.
Following Link Will Help you to get better explanation:
creating a Java Proxy Server that accepts HTTPS

How to configure Node-RED from behind proxy

I'm trying to run Node-RED on IBM Bluemix from pc that is behind http/https proxy.
In case with proxy, I encounter the error 'Lost connection to server, reconnecting in 10s'
How can we run our Node-RED from behind proxy?
This is likely because the proxy is dropping the WebSockets connection to the Node-RED instance on Bluemix.
Try making sure you are accessing the Node-RED instance via HTTPS as this is likely to tunnel the entire connection between the browser and the server via a HTTP Connect call which has been shown in the past to be more stable.

Can Java program establish JDBC Connection via Proxy Server

I want to communicate to Oracle DB Server which sits outside my network via the proxy server.
I can access the web application hosted on the same machine via Browser with proxy settings.
Can a simple Java program establish JDBC Connection thru the proxy server?
*To provide an example will be better *
If the proxy is only a HTTP proxy, then no.
But if the proxy transfers TCP/IP trafic, then you can.
How to do that, look at How do I set the proxy to be used by the JVM or http://docs.oracle.com/javase/6/docs/technotes/guides/net/proxies.html

Java server on OpenShift

At the moment i have an android client app which connects to my java server through socket - serversocket. It sends and receive strings. The java server is connected to a mysql database (actually mariadb) using the jdbc driver.
I succeed to create a jbossas application and upload the code of the java server to openshift, but i didn't find any detailed tutorial on how do i connect to this new uploaded server from my socket client (This one (RMI or socket connection to Java Program on OpenShift) gives some tips but i'm still stucked).
More on this, how do i know that my server runs just fine on openshift and how do i control de calls to the database after i connect it (found this: $ rhc app create MyApp jbossas-7
$ rhc cartridge add mysql-5.5 -a MyApp), using org.mariadb.jdbc.Driver and java.sql is still working ?
Any small guide or tip is highly appreciated. I'm new to these things so please don't be too heavy on comments.
You can only make connections to your OpenShift server on http/https or ws/wss ports. If you want to connect to your java application and pull data from it from an android device, I would suggest using a RESTful api or a servlet, etc.
I had similar problem: My app server originally was running as a ServerSocket listener, and any clients/devices connect to it directly via Socket binding.
To deploy it into OpenShift, my previous initial solution was to change its host:port configuration by following the suggestion as described in this link [Socket connection to Java Program on OpenShift]. It worked nice as far as my app server was successfully up and running. But it did not work well with the port forwarding approach in order to accept remote requests.
So for the final solution, I modified the app server by wrapping my original code with a RESTful webservice around it, and deploy it as a web service.