I have written a javascript web app for document processing. I now desire to hit some web services such as NLTK-server, TIKA-server, and SOLR, for additional processing.
I am able to hit the REST endpoints of all these using curl, but trying to move to javascript/jquery/Ajax I ran into the same-origin (CORS) problem that many have asked about here. It seems the solution is setting up a reverse proxy, and while I understand the concept, the searches I've done provide results that are way over my head. As common as this problem must be (Web apps hitting web services), I have to think that there must be a simple solution. I'm a developer, not a sys admin and reading how to set up Jetty (For example) as a reverse proxy is an exercise in frustration. Would appreciate if someone could point me to a "Proxy 101" tutorial, as my google-fu has come up short.
**************EDIT************************
I'm developing in Netbeans (I know it's overkill but been using it for years and am comfortable with it) with the embedded GlassFish server. So when executed, I'm running localhost:8383. As for the "Services" I'm hitting, I run:
java -jar tika-server
and it starts up the tika-server listening on port 9998 (also on localhost) and I'm able to submit/retrieve docs using curl. However, when I submit a document to Tika via ajax, I get the CORS error. I was able to hit the SOLR server, but only because I modified the AJAX request to include:
wt:'json'
because Solr supports JSONP. However, I can not assume that every web service I want to hit supports JSONP. I'm using Tika to extract text from .pdfs, .docx ... I've done so in the past when writing Java code, and just including the jar, but trying to move to a web front end is proving difficult.