Provide external data: failing due to SOP

17 views
Skip to first unread message

Fabian

unread,
Jan 26, 2012, 2:53:58 AM1/26/12
to EtherPad Open Source Discussion
Hi!

We are using EtherPad Lite to write papers. Therefor we want to
"include" our literature database. Every citations is represented by
and id surrounded by brackets e.g. [[2279]]. For comfort reasons I
want to have an mouseover for that citations to get the author, title,
etc. shown in a tooltip. Therefor I have to send an request to the
literature database (which is running on the same server but as php
application on port 80). Due to the different ports I get in conflict
with the same-origin-policy using AJAX to get stuff done in the
background.

Can anybody see a possibility how avoid this?

Is it possible to "re-route" the request via etherpad? jQuery -> send
request on port 9001 -> node.js -> redirect request to literature
databse on port 80 -> send data back the same way. But I'm not into
node.js at all, so I see no possibility how to get this into the code.

John McLear

unread,
Jan 26, 2012, 9:08:01 AM1/26/12
to etherpad-open-...@googlegroups.com
I use varnish to handle the same-origin-policy issue.

Fabian

unread,
Jan 26, 2012, 10:23:14 AM1/26/12
to EtherPad Open Source Discussion
Unfortunately I must use a Windows host.

John McLear

unread,
Jan 26, 2012, 10:28:05 AM1/26/12
to etherpad-open-...@googlegroups.com
In production?

Fabian

unread,
Jan 26, 2012, 10:41:57 AM1/26/12
to EtherPad Open Source Discussion
On 26 Jan., 16:28, John McLear <johnym...@gmail.com> wrote:
> In production?
Yes, we use etherpad lite on a windows host as "productive" system.

Eugene Mirotin

unread,
Jan 26, 2012, 12:29:57 PM1/26/12
to etherpad-open-...@googlegroups.com
In your PHP app add Access-Control-Allow-Origin: Etherpad address (on the code level add an extra header in response to OPTIONS request or set it up on the web server's level)

John McLear

unread,
Jan 30, 2012, 11:53:16 AM1/30/12
to etherpad-open-...@googlegroups.com
Did this work for you?

Fabian

unread,
Jan 31, 2012, 10:22:59 AM1/31/12
to EtherPad Open Source Discussion
On 30 Jan., 17:53, John McLear <johnym...@gmail.com> wrote:
> Did this work for you?

Haven't tried that. But there has been another message (just send to
me, don't know why not as an answer here) proposing a reverse proxy.
I just managed to get this reverse proxy running (IIS 7, not my
favourite webserver) on a test machine. Now everything is running on
the same host and port:

http://mysystem/etherpad
http://mysystem/lit

As soon as I get this running on our productive system I will test the
ajax stuff and report here!

Fabian

unread,
Feb 2, 2012, 4:53:18 AM2/2/12
to EtherPad Open Source Discussion
I've now installed the reverse proxy on our live system and everything
is working fine. Ajax requests are possible and everything I need is
available.

If somebody else is working with Etherpad Lite on windows and has to
use the IIS and wants to achieve the same thing I have done: See
https://blogs.msdn.com/b/carlosag/archive/2010/04/02/setting-up-a-reverse-proxy-using-iis-url-rewrite-and-arr.aspx?Redirected=true
for information about how to set up a reverse proxy.

On 31 Jan., 16:22, Fabian <fpfan...@googlemail.com> wrote:
> On 30 Jan., 17:53, John McLear <johnym...@gmail.com> wrote:
>
> > Did this work for you?
>
> Haven't tried that. But there has been another message (just send to
> me, don't know why not as an answer here) proposing a reverse proxy.
> I just managed to get this reverse proxy running (IIS 7, not my
> favourite webserver) on a test machine. Now everything is running on
> the same host and port:
>
> http://mysystem/etherpadhttp://mysystem/lit

John McLear

unread,
Feb 2, 2012, 10:52:57 AM2/2/12
to etherpad-open-...@googlegroups.com
Great job :) Thanks!
Reply all
Reply to author
Forward
0 new messages