Cross-domain
Introduction
From version 3.53.2 it is possible to place the plugin's dynamic contents on a different server. To enable the communication between servers, you need to change the location of your integration dynamic contents directory (integration) and enable CORS in your configuration.ini
file.
configuration.ini
file.Note
Note: In the instructions below <server-static>
will be the static content server and <server-dynamic>
the dynamic content server.
Move integration directory
.NET and PHP
Move the integration directory to
<server-dynamic>/<plugin-path>
.Move your configuration.ini file next to the integration directory on
<server-dynamic>
:
<server-dynamic>/<plugin-path>/integration
<server-dynamic>/<plugin-path>/configuration.ini
Change the src of
WIRISplugins.js
in<server-static>
to
<protocol>://<server-dynamic>:<port>/<plugin-path>/integration/WIRISplugins.js?viewer=image
Add
wiriscontextpath="<protocol>://<server-dynamic>:<port>/<plugin-path>"
variable in your configuration.ini
file.
Edit
<server-static>/<plugin-path>/<plugin>.js
and set
_wrs_int_conf_file="<protocol>://<server-dynamic>:<port>/<plugin-path>/configurationjs.<aspx|php>".
Java
Change the src of
WIRISplugins.js
in<server-static>
to
"<protocol>://<server-dynamic>:<port>/<pluginwiris_engine-path>/app/WIRISplugins.js?viewer=image"
Add
wiriscontextpath="<protocol>://<server-dynamic>:<port>/<pluginwiris_engine-path>"
in your configuration.ini
file.
Edit
<server-static>/<plugin-path>/<plugin>.js
and set
_wrs_int_conf_file="<protocol>://<server-dynamic>:<port>/<pluginwiris_engine-path>/app/configurationjs"
Open
wirisplugin-engine.jar
insidepluginwiris_engine/WEB-INF/lib
and change the value ofthis.javaServicePath
inWIRISplugins.js
for
<protocol>://<server-dynamic>:<port>/<pluginwiris_engine-path>/app/
Enable CORS
Add
wiriscorsenabled=true
in your server-dynamic'sconfiguration.ini
file.If you need to enable CORS only for a group of servers you need to follow these additional steps too:
Add a file called ''corsservers.ini'' at the same directory level of
configuration.ini
file.Add the servers you need in ''corsservers.ini'' (one per line) using this format:
<protocol>://<server>:<port>