Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] My CORS proxy using Jersey (for JAX-RS) with Jetty 9.4.31 doesn't respond

Hello

 

I try to replace this service:

http://allorigins.win/

"Pull contents from any page via API (as JSON/P or raw) and avoid Same-origin policy problems"

 

I use JAX-RS, I obtain an HTTP error 404 when trying to use my web service:

http://80.13.94.99/feed/webresources/corsproxy/raw?url="">

 

I use "feed" in the deployment descriptor for Jetty, @ApplicationPath("webresources"), @Path("corsproxy") and @Path("raw?url="" that's why I expected the above path to work.

 

I have to parse XML (RSS, Atom, OPML) files on the client, in _javascript_. However, many CORS policies prevent me from doing that directly in the client. I use http://allorigins.win but I don't want to rely on a third party CORS proxy on the long term. Using a CORS proxy allows the client to bypass CORS policies to be able to get the files and parse them.

 

I use Tor Browser and Mozilla Firefox 68 & 79. I don't use my broken CORS proxy in _javascript_ yet, I wanted to make sure it works in my test in a web browser by accessing the URL of the web service before using it in my source code. I want to use it here:

https://sourceforge.net/p/red-feed-aggregator/code/ci/master/tree/src/main/webapp/feed.js#l272

 

Thank you for your help.

 

> Message du 06/08/20 10:02
> De : "Simone Bordet" <sbordet@xxxxxxxxxxx>
> A : gouessej@xxxxxxxxx, "JETTY user mailing list" <jetty-users@xxxxxxxxxxx>
> Copie à :
> Objet : Re: [jetty-users] My CORS proxy using Jersey (for JAX-RS) with Jetty 9.4.31 doesn't respond
>
> Hi,
>
> On Wed, Aug 5, 2020 at 11:32 PM <gouessej@xxxxxxxxx> wrote:
> >
> > Hello
> >
> > I'm trying to implement a CORS proxy to replace the third party CORS proxy I've been using for weeks. I need a CORS proxy to work around some CORS policies by downloading the files on the server in a web service called from the client that receives some plain text.
> >
> > The source code of my project is here:
> > https://sourceforge.net/p/red-feed-aggregator/code/ci/master/tree/
> >
> > The two commits concerning the CORS proxy are here:
> > https://sourceforge.net/p/red-feed-aggregator/code/ci/a3a1c6e602e1415aba8381c62bbb17ebea6f91f8/
> > https://sourceforge.net/p/red-feed-aggregator/code/ci/b8ed01b2b4344d6f79ab359baf66a1797feea675/
> >
> > I have no exception in the logs.
> >
> > The feed aggregator works:
> > http://80.13.94.99/feed/
> >
> > but the CORS proxy doesn't:
> > http://80.13.94.99/webresources/corsproxy/raw?url="" />> > http://80.13.94.99/feed/webresources/corsproxy/raw?url="" />> >
> > Please can you tell me what I'm missing? Maybe I should add something into web.xml so that the servlet is loaded at startup.
>
> I frankly don't understand what you're trying to do.
> You don't need a CORS "proxy", just a Servlet Filter. Jetty provides
> one already, have you tried to use it?
>
> Can you please describe in detail what does not work?
> Specify the origin of the _javascript_, where it wants to send a request
> to, and a dump of the request/response, including preflights.
> Also important is what browser do you use?
>
> --
> Simone Bordet
> ----
> http://cometd.org
> http://webtide.com
> Developer advice, training, services and support
> from the Jetty & CometD experts.
>

Back to the top