Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

:sparkles: Adds Server Sent Events debug support

Liyas Thomas0383403ccec7
diff --git a/README.md b/README.md
index d42e66588..687f49543 100644
--- a/README.md
+++ b/README.md
@@ -91,6 +91,10 @@ _Customized themes are also synced with local session storage_
- Send and receive data
+📡 **Server Sent Events**: Receive a stream of updates from a server over a HTTP connection without resorting to polling.
+
+ - Receive data
+
🌍 **GraphQL**: GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data.
- Set endpoint and get schemas
diff --git a/layouts/default.vue b/layouts/default.vue
index fc15fd766..e13d12aae 100644
--- a/layouts/default.vue
+++ b/layouts/default.vue
@@ -101,9 +101,9 @@
<logo alt style="height: 24px;"></logo>
</nuxt-link>
<nuxt-link
- to="/websocket"
- :class="linkActive('/websocket')"
- v-tooltip.right="'WebSocket'"
+ to="/realtime"
+ :class="linkActive('/realtime')"
+ v-tooltip.right="'Realtime'"
>
<i class="material-icons">settings_input_hdmi</i>
</nuxt-link>
@@ -144,7 +144,7 @@
</ul>
</nav>
</div>
- <div v-else-if="['/websocket'].includes($route.path)">
+ <div v-else-if="['/realtime'].includes($route.path)">
<nav class="secondary-nav">
<ul>
<li>
diff --git a/nuxt.config.js b/nuxt.config.js
index 30c451c82..e9e1716d4 100644
--- a/nuxt.config.js
+++ b/nuxt.config.js
@@ -43,7 +43,7 @@ export default {
},
{
name: 'keywords',
- content: 'postwoman, postwoman chrome, postwoman online, postwoman for mac, postwoman app, postwoman for windows, postwoman google chrome, postwoman chrome app, get postwoman, postwoman web, postwoman android, postwoman app for chrome, postwoman mobile app, postwoman web app, api, request, testing, tool, rest, websocket'
+ content: 'postwoman, postwoman chrome, postwoman online, postwoman for mac, postwoman app, postwoman for windows, postwoman google chrome, postwoman chrome app, get postwoman, postwoman web, postwoman android, postwoman app for chrome, postwoman mobile app, postwoman web app, api, request, testing, tool, rest, websocket, sse, graphql'
},
{
name: 'X-UA-Compatible',
diff --git a/pages/websocket.vue b/pages/realtime.vue
similarity index 98%
rename from pages/websocket.vue
rename to pages/realtime.vue
index d512153a7..bbf2eee0c 100644
--- a/pages/websocket.vue
+++ b/pages/realtime.vue
@@ -194,7 +194,7 @@ export default {
input: ""
},
connectionSSEState: false,
- server: "https://wgrothaus.ucc.ie/~frank/cs3513/server_event_source.php",
+ server: "https://express-eventsource.herokuapp.com/events",
sse: null,
events: {
log: null,
@@ -227,7 +227,7 @@ export default {
"((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|" +
"((\\d{1,3}\\.){3}\\d{1,3}))" +
"(\\:\\d+)?(\\/[-a-z\\d%_.~+@]*)*" +
- "(\\?[;&a-z\\d%_.~+=-]*)?" +
+ "(\\?[:\\;&a-z\\d%_.~+=-]*)?" +
"(\\#[-a-z\\d_]*)?$",
"i"
);
@@ -429,7 +429,7 @@ export default {
});
},
stop() {
- if (this.sse !== null) this.sse.close();
+ this.sse.close();
}
},
updated: function() {