This is a proxy solution to use with WebViewer-HTML that allows loading external HTML web pages so that HTML pages can be annotated.
See the npm package on @pdftron/webviewer-html-proxy-server for more information.
Methods
-
<static> createServer(options)
-
Initializes the proxy server to load external HTML pages.
Parameters:
Name Type Description options
object The options objects containing SERVER_ROOT, PORT. Properties
Name Type Argument Description SERVER_ROOT
string Start the server on the specified host and port PORT
number Start the server on the specified host and port CORS_OPTIONS
cors.CorsOptions <optional>
An object to configure CORS. See https://expressjs.com/en/resources/middleware/cors.html COOKIE_SETTING
express.CookieOptions <optional>
An object to configure COOKIE. See https://expressjs.com/en/api.html#res.cookie ALLOW_POTENTIALLY_UNSAFE_URL
boolean <optional>
Boolean containing value to disable URL validation. Setting this to true will override ALLOW_HTTP_PROXY. ALLOW_HTTP_PROXY
boolean <optional>
Boolean containing value to allow loading localhost files and for unsecured HTTP websites to be proxied. Returns:
- Type
- void
Example
const HTMLProxyServer = require('@pdftron/webviewer-html-proxy-server'); HTMLProxyServer.createServer({ SERVER_ROOT: `http://localhost`, PORT: 3100 });