Opening Foxx API to local network - server

I have setup serverend points they work for the web interface fine but the api endpoint for my for app do not even give a error and does not time out.
I have tried turn the app to production mode in the web interfaces no joy.
I look at the doc for server setup but can find any thing to help.
So I would think their is configure issue where should I look?
On localhost ever thing works.
On remote host where using 168.192.0.15:8530 only web interface works not my api form either curl or may app

Without further information I can only guess what the problem is, but I'll try:
The default --server.endpoint configuration value for an ArangoDB server is tcp://127.0.0.1:8529. That means you will be able to access it from the local machine but not from other hosts.
To make the server respond to HTTP requests originated from other hosts, you will need to use an endpoint that includes the server's IP address as used in your network, e.g. tcp://192.168.173.13:8529 and restart it with the adjusted configuration.
If that's not working either, can you trying calling the target URL from another server via curl and check the server's HTTP response code. This might reveal the source of the problem, too. Note that you should invoke curl with the option --dump - to see the HTTP response code. For example:
curl -X GET --dump - http://192.168.173.13:8529/your/app
If that is not producing any results (i.e. no response at all), you might have a firewall in between that blocks requests. Probably you need to allow access on the port ArangoDB uses (8529 by default and used in my example).

So I have learn the issue is the api endpoint url is not the same on localhost at their are from outside. Example:
curl -X GET --dump - http://localhost:8529/broad/broad/login
curl -X GET --dump - http://192.168.0.15:8530/_db/_system/broad/broad/login
https://docs.arangodb.com/cookbook/MakingFoxxAppAccessible.html
This lead me to my answer

Related

Get content from local server when accessing a custom local url (http://localost:8080 from http://localhost/testing)

I apologize if i'm being vague, but i don't know how to ask in more technical terms.
I have a server running on my local machine on a random (known) port. I started it with python -m SimpleHTTPServer 8080. I want to be able to type http://localhost/testing or any url (if the solution is simpler) and get that content that's served on the above mentioned port. The url i'm accessing needs to be <something/somethingelse> (have a slash in there). Reason being, i'm doing some url manipulation and need to test different scenarios.
ex: server is serving content on http://localhost:8080 - i want to type http://localhost/testing in the browser url and get whatever's served on localhost:8080.
I couldn't do it with hosts mapping. I'm on a mac.
The question would be much clearer if you used complete URLs. I'm guessing what you're asking for is a redirect or a proxy:
From http://localhost/testing
To: http://localhost:8080
The solution would be to install a web server (separate from the python SimpleHTTPServer) that is configured to listen on port 80 and redirect based on URL path, e.g.
if URL path == /testing,
then redirect to http://localhost:8080
Depending on your platform, you might use nginx (linux/macos) or IIS (windows). You might even be able to use nginx on Windows if you're using WSL. Instructions for installing and configuring those packages.
Configuring a simple redirect is far easier than a proxy.

Sending HTTP via proxy with haproxy

We have a company proxy (ip:port) and need to send HTTP POST with json payload to the URL like "http://server1.smthng.com/foo". Locally, name could not be resolved, but it is resolved at proxy. I dont understand how to configure haproxy to use proxy "ip:port" and send request without modifying the original URL.
I've tried curl to "http://server1.smthng.com/foo" after setting https_proxy variable from CLI (in linux) and it worked for me, so now I need to replicate same via haproxy.
From curl logs I could see that it first makes a CONNECT to proxy and once connection is there it POSTs the data.
I could be missing some knowledge here regarding tcp tunnels and the answer could be simple really. Anyway, need help.
The question is to be closed with no asnwer. The solution we took is via civetweb htt_proxy parameters.

REST API with Single Page Application over HTTPS on Firefox only

I am developing a web service using REST API. This REST API is running on port 6443 for HTTPS. Client is going to be a Single page application running on port 443 for HTTPS on same machine. The problem I am facing is:
While I hit the url say: https://mymachine.com/new_ui I get certificate exception for an invalid certificate because I use a self signed one, so mymachine.com:443 gets added to server exception. But still requests doen't go to REST API as they are running on https://mymachine.com:6443/restservice. If I manually add mymachine.com:6443 to server exception on firefox it works but it will not be the case in production for customers.
Some options that I thought are:
1. Give another pop up and ask to add REST server on port 6443 exception too.But this doesn't look proper as why an end user should accept the cerf for same domain twice. Also REST api server port can change.
Can we programmatically add exception for domain and both the ports in one shot? Ofcourse with the consent of the user. 3. Use a reverse proxy. But then its going to have memory footprint on our system. Also it will be time consuming.
Please suggest some options. How do I deal with it. Thank you

Parse-Server Rest API HTTP Authentication

I can not get the Rest API to work with Basic Authentication like in the guide i.e. https://myAppID:javascript-key=myJavaScriptKey#api.parse.com/1/classes/GameScore/Ed1nuqPvcm.
I can make it work if I use curl and pass the keys via HTTP Headers, however I'm trying to use a WebHook from another service and I don't have the ability to send HTTP headers.
2 issues when trying locally:
http(s) does not work even locally.
http gives me error:unauthorized.
I'm using parse-server installed via npm globally but don't see a place to add cert.
Please help!
I was able to use http local and remote using the format http://myAppId:myMasterKey#mydomain.com:1337/parse/classes/myClass and it worked fine. If you use Postman you have to turn on Basic Auth in the header section.

Azure Websites: socket reading port 80 returns 404 error

I have a php script that run perfectly when requested by the browser (example):
http://www.kwiksher.com/k3Serial.php?key="XXXXX"
in this case, I get the information of an user with the key XXXXX, which is the expected behavior.
However, inside my Photoshop plugin, I must to call it via socket, having to force a port in the connection:
http://www.kwiksher.com:80/k3Serial.php?key="XXXXX"
Doing that, I get the the content of Azure default 404 page (it is not even my customized 404 page).
If I use the same call (with the port added to the domain) on a browser, it works fine as well.
Any idea on how to fix it? I tried to flushDNS on my machine as well without success.
Thanks a lot,
Alex
It's likely that the socket library won't be using HTTP and therefore isn't sending a host header and the web tier on Azure can't actually figure out which Website it should serve the content from.
As you using this with a plug-in perhaps try and use the default hostname issued by Azure instead of a custom domain.