Skip to content

Failing to serve the JPro application from a base path #199

@fapdash

Description

@fapdash

I need to serve jpro applications from a base path: example.com/proxy/jpro/<some-dynamic-id>.
There currently seems to be no configuration option to specify a base path like that?

I've tried to work around that but the web socket connection still can't be established since JPro tries to load it via absolute path.

What I've done so far to work around that

I've created a custom index.html that accesses the JPro .js and .css files via relativ path.

src/main/resources/jpro/html/index.html:

<!DOCTYPE html>

<html>
  <head>
    <title>My JPro Application</title>

    <meta
      name="viewport"
      content="width=device-width, initial-scale=1.0, 
user-scalable=no"
    />

    <link
      rel="stylesheet"
      type="text/css"
      href="jpro/css/jpro-fullscreen.css"
    />

    <link rel="stylesheet" type="text/css" href="jpro/css/jpro.css" />

    <script src="jpro/js/jpro.js" type="text/javascript"></script>
  </head>

  <body>
    <jpro-app href="app/default" fullscreen="true"></jpro-app>
  </body>
</html>

With this change the loading animation of JPro appears, but the app doesn't get loaded.

What still doesn't work

The app doesn't load because JPro tries to establish a websocket connection via

GET wss://app/app/ws/default

which of course is not a valid URL.

Is there a way to let JPro work when loaded from a base path / subpath?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions