Running an app on Bluemix results in a tunneling socket error - proxy

I have added the proxy with an n.p.m installation. However, when I run my app locally it shows this error:
tunneling socket could not be established, cause=getaddrinfo ENOTFOUND 80
What could be the problem? Is it that my added proxy is wrong or is there something else? If it is the former issue, please give me the steps to fix it. Thank you in advance.

I understand you're trying to use the Tradeoff Analytics service. If all you need is a simple proxy, which does not do anything other than forward the \dilemma calls to the service, you might want to consider using the simplified proxy from the new UI's demo page. With this proxy, it's basically a two-liner to set-up a proxy.
To do that, please go to our GitHub project. Here are the steps you need to do in order to use the simple proxy:
Add "http-proxy-middleware": "^0.9.0" to your package.json (this is the only dependency the simplified proxy needs).
Copy the file tradeoff-analytics-proxy.js from our project.
require it in your app.js - see line 20 in the sample app.js
Run it - it will return an Express "middleware" you'll need to send to app.use() - see line 24.
If you're using the Tradeoff Analytics UI Widget, you will need to change the dilemmaServiceUrl to /tradeoff-analytics-proxy/dilemmas. See line 16 of public/index.js.

No need to add a proxy via npm installations. And it definately is the cause for your problem.
It is best to use the app.js provided that essentially acts a proxy for the browser requests to Bluemix

Related

React native project created by expo how to enable http requests to a server on the localhost

as the title suggests I've used the react native expo quick start guide and managed to setup a basic project. Everything worked just fine until it came to making fetch requests to my local server by laravel 8. It seems both android and ios don't allow making http calls unless you change some config in your android folder which I don't have for using expo. Tried googling for my answer but I keep running into dead ends. Is there any way to enable this or should I try migrating my back-end temporarily to heroku or something similar? Thank you for reading.
Edit: Forgot to mention each time i make a call to the wrong route I immediately get Network error while hitting the right routes throws an unresolved promise

How to run multiple web APIs from same solution?

I'm trying to run multile Web APIs located in the same solution. One API i can acces with /client/1(project OtherApi) and the other API i call with /customer/1(project ConcurrentAPI). When i run the entire solution only /client/1 is giving me a response and when I try to call /customer/1 im getting an HTTP 404 error(look image).
I have already tried setting both projects as startup projects but this did not work.
Any thoughts?
Thanks in advance!
You try to run two processes that will listen to the same port.
I guess one of them will warn you that the port is busy.
So you may use different port in each solution, and then, access to each API using the appropriate port.

Play Framework serve HTTPS content

I am a newbie at play, and I am trying at least to use HTTPS on a login and sign up pages in order to have more security on sensitive user data.
I have a range of questions regarding this:
I have configured my play application to use https on the application.conf file with the https.port property. However in my development environment I cant seem to start the server with https capability unless I use the command: play -Dhttps.port=<port>
Why does this happen? I would think that I could use a dev.conf (right now is the application.conf) file in order to do this. Can't I start the server in dev mode while using this kind of settings specified on the configuration file?
Although I start the server with https capabilities, what is the correct way to use https on play? I already created a java key store that I use, and tried to redirect (from a controller) requests to a https url using redirect(securedIndexCall.absoluteURL(request, secure)). But it does not seem to work at least on my dev enviroment (localhost). The logs specify exceptions like:
java.lang.IllegalArgumentException: empty text
java.lang.IllegalArgumentException: invalid version format: M¥å/=<junk characters continue>
Should I use https on the whole application, or just securing the login and sign up requests is sufficient?
I feel the official documentation provided is rather insufficient and I am at a loss here trying to figure out how I should do this.
Any help would be really appreciated!
I agree with Fernando, I think it's easier to set up a front end web server. In my case I used Lighttpd and it was fairly straightforward to set up. I'd recommend:
Configure Lighttpd as per these instructions (at this stage, don't worry about HTTPS just get HTTP working): http://www.playframework.com/documentation/2.3.x/HTTPServer
Then configure HTTPS in Lighttpd: http://redmine.lighttpd.net/projects/1/wiki/HowToSimpleSSL. If you intend on buying an SSL certificate then there will be a few more options to set (e.g. intermediate certificate). The following page has more information: http://redmine.lighttpd.net/projects/1/wiki/Docs_SSL
Answers to your main questions:
1) Enabling HTTPS in Play
Yes, you have to explicitly say you want to use HTTPS when starting up
http://www.playframework.com/documentation/2.3.x/ConfiguringHttps
2) The "java.lang.IllegalArgumentException" error message
There might be an issue with the keystore. This SO article seems to discuss in more detail: Play framework 2.2.1 HTTPs fails on connection attempt
3) SSL for login page or whole app
Personally, I would go for the whole app. If you're taking the time to set up HTTPS I think you might as well cover the whole site. I guess there are slight performance overheads in running HTTPS but realistically it's not something you'd notice.
You should use a front end server for HTTPS, and use HTTPS for the whole application.
Please see Setting up a front end HTTP server and see the commented out nginx settings.

Web API on IIS7.5 Unable to download * from localhost

I'm currently trying to install web api project directly from vs 2013 to my local dev machine, but when I test one of my http get controllers, I get the following:
My url looks like this:
http://localhost:8081/api/Location/States?queryTerm=Ark
When I test this on my local, this url works and I get my json response.
pay no attention to the web config error in the background. If I enter anything invalid, I get an IIS error, so I know I'm hitting the right URL.
Side note: I'm using IE8 for testing.
I found out the solution, and it may be a config thing, but when I made this as an virtual application to a website, this went away, and it gave me a yellow sign of death (which is a good thing). I was able to deduce this to be an oracle issue, where it couldn't find the database connection, and then found out it couldn't resolve tns names.
So I guess Web API can not be hosted by itself on IIS? I haven't looked into it, but it seems this to be the case, unless there needs to be more tweaking involved.
i know too late for response. But i get same error when I try deploy Odata v4 Application in IIS server.
In server , i hit this error as above, i try everything config but nothing change.
At last, i try connect from client and it work.
I recognize that in Client , it download a json file from Server (in case use Odata , it seem like wsdl file in webservice) and API still work well.
For some reason, it cant download in server, but dont worry, it still work.
Hope this helps!

SoapUI global proxy testings not taken for test execution

I have created a web test project using the SoapUi GUI (free version). I need a proxy to connect to the Internet. Therefore, I have set the proxy host and port in File->Preferences->Proxy Settings and made sure that it is enabled. I know the proxy settings are correct, because I see the "soapUi Starter Page" properly. But to my surprise, these global proxy settings do not seem to be taken when running the web test case (I just configured a HTTP GET for http://www.google.com), and my request always times out.
I have failed to make it work both with version 4.0.1 and with 4.05 beta 1.
Can anyone help me with this?
Thanks
can you try with http://stackoverflow.com?
It seems soapui doesn't handle redirect right.

Resources