Project

General

Profile

How to do server send events (SSE) or server push between two WServer instances?

Added by Stefan Bn about 3 years ago

I'm currently in the design phase and think about the following setup:


                          │
┌────────────────┐        │       ┌─────────────────┐
│                │        │       │                 │
│                │        │       │                 │
│  Wt Server A   │        │       │   Wt Server B   │
│                │  HTTP  │       │                 │
│      WWW       │◄───────┼───────┤     Intranet    │
│                │        │       │                 │
│                │        │       │                 │
│                │        │       │                 │
└────────────────┘        │       └─────────────────┘
                          │
                          │
  • WServer A is on a domain in the WWW, collecting sensible data from users that should only be processed and long-time stored by WServer B

  • WServer B is in an intranet, encapsulated behind a firewall and not accessible from outside/WWW

  • WServer B can act as a HTTP/HTTPS client and send HTTP requests to WServer A and receive HTTP responses on TCP ports 80/443

I'm looking for a way to push Server-send events (SSE) to inform about new data from WServer A to WServer B. For example WServer B establishes a HTTP connection to WServer A, keeps that connection open and waits for incoming events.
Would this be possible using the Wt Framework and how? Or in any alternate way?

I'm aware of post/postall as well as examples/feature/serverpush and examples/feature/broadcast. However these aim at communication inside a single WServer instance. I'm looking for an event mechanism between two WServer instances.

(The alternative would be for WServer B to regularly send update requests to WServer A, but that will generate unnecessary traffic)

Thanks,
Stefan