You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Old style REST API devices have GET/PUT commands whereby the client can read/write data to the server (i.e. a client driven, polling mechanism). But nowadays many REST API devices also support Server Sent Eventing (SSE) whereby the server can inform the client directly if anything changes. (i.e. a server event driven mechanism).
Example
This is often the case in home automation devices (e.g. Philips Hue) where the server device can (say) notify the client that a light was turned on or a temperature has changed.
Analog
Some implementers use SSE to send event notifications. But some use WebSockets instead. The implementation is slightly different, but the purpose is the same. => So see #83
Proposed Solution
Mockoon should add the following features..
Ability for a client to open an SSE connection to Mockoon server.
(Ditto ability for the client to open a WebSocket connection to Mockoon server).
Ability to define response payloads (usually JSON) that Mockoon server can send over the SSE (resp. WebSocket) connection.
Above mentioned responses are sent with a delay of (0 .. n seconds) after the connection is opened (or even a random delay to simulate real life events).
Above mentioned responses would allow variable contents, as with existing Mockoon responses, to simulate real life.
I think this issue could get more popular with the rise of the "GPT" world. Because, those GPT APIs uses SSEs to transfer the real-time generating contents.
The reasons I see:
Popularity of GPT APIs.
Cost of Usage: Also, these APIs are commercialized or rate-limited. So, using actual APIs are limited in development or test environments due to the additional incurring cost to the organization. Hence, developers would expect a mocking API in their local machine/non-production environments.
Predictability: Such GPT APIs tend to produce non-deterministic results even with the same inputs. So, sometime troubleshooting a scenario would not be easy and may require a help from mocking API to simulate with such troublesome responses and behaviors.
Issue
Old style REST API devices have GET/PUT commands whereby the client can read/write data to the server (i.e. a client driven, polling mechanism). But nowadays many REST API devices also support Server Sent Eventing (SSE) whereby the server can inform the client directly if anything changes. (i.e. a server event driven mechanism).
Example
This is often the case in home automation devices (e.g. Philips Hue) where the server device can (say) notify the client that a light was turned on or a temperature has changed.
Analog
Some implementers use SSE to send event notifications. But some use WebSockets instead. The implementation is slightly different, but the purpose is the same. => So see #83
Proposed Solution
Mockoon should add the following features..
Signed-off-by: Andrew Fiddian-Green software@whitebear.ch
The text was updated successfully, but these errors were encountered: