Skip to content

Instantly share code, notes, and snippets.

View eingress's full-sized avatar
:octocat:

Eingress Ltd eingress

:octocat:
View GitHub Profile
@eingress
eingress / revprox.go
Created May 27, 2024 16:31 — forked from JalfResi/revprox.go
Simple reverse proxy in Go
package main
import(
"log"
"net/url"
"net/http"
"net/http/httputil"
)
func main() {
@eingress
eingress / hasura_connect_ex.dart
Created March 4, 2024 09:38 — forked from osaxma/hasura_connect_ex.dart
a workaround for keeping haura_connect subscriptions alive when using JWT
import 'dart:async';
import 'package:meta/meta.dart';
import 'package:hasura_connect/hasura_connect.dart';
import 'package:http/http.dart' as http;
// problem:
// when subscribing to`HasuraConnect.subscription`, a websocket connection is created on the first subscription
// call. The websocket connection is created only once with the initial subscription and the provided TokenInterceptor
// or headers. When the token expires during an active subscription, HasuraConnect doesn't stop the subscription, or try
// to reconnect with the latest token in in the TokenInterceptor nor does it throw an error. It'll keep calling `onRequest`