{"id":37202880,"url":"https://github.com/mlctrez/go-nats-app","last_synced_at":"2026-01-14T23:24:18.732Z","repository":{"id":64411393,"uuid":"575192241","full_name":"mlctrez/go-nats-app","owner":"mlctrez","description":null,"archived":false,"fork":false,"pushed_at":"2023-08-24T20:57:36.000Z","size":2885,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-17T22:51:43.717Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mlctrez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-07T00:40:03.000Z","updated_at":"2023-08-19T09:36:57.000Z","dependencies_parsed_at":"2024-06-20T03:18:14.366Z","dependency_job_id":"bc70d3cb-c7a6-427a-83bb-a939c7e2352b","html_url":"https://github.com/mlctrez/go-nats-app","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/mlctrez/go-nats-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlctrez%2Fgo-nats-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlctrez%2Fgo-nats-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlctrez%2Fgo-nats-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlctrez%2Fgo-nats-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mlctrez","download_url":"https://codeload.github.com/mlctrez/go-nats-app/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlctrez%2Fgo-nats-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28437981,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T22:37:52.437Z","status":"ssl_error","status_checked_at":"2026-01-14T22:37:31.496Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T23:24:18.131Z","updated_at":"2026-01-14T23:24:18.714Z","avatar_url":"https://github.com/mlctrez.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-nats-app\n\nA spin-off of [go-nats-app](https://github.com/oderwat/go-nats-app/). See the readme there for full details.\n\nCredit to [Hans](https://github.com/oderwat/) for the original and sending me on this journey.\n\nMost of the original code is in [setupNatsApi](api/api.go#L41) for the server\nand [front.go](goapp/compo/front/front.go) for the client. Nats server setup is\nin [service.go](goapp/service/service.go#L222).\n\n### Changes in this spin-off\n\nIn the original code, the nats client in the wasm connects to the nats server\nusing a [Nats Websocket](https://docs.nats.io/running-a-nats-service/configuration/websocket) via\na [CustomDialer](https://github.com/nats-io/nats.go/blob/6c6add8d63597f84bee75d37bb1520e01552a02d/nats.go#L252).\n\n`Go-App -\u003e Nats Client -\u003e \u003cNats WebSocket\u003e -\u003e WebSocket Endpoint`\n\nIn the (now updated) spin-off, the nats client in the wasm connects using [goapp-natsws](https://github.com/mlctrez/goapp-natsws).\n\n`Go-App -\u003e Nats Client -\u003e \u003cnatsws.Connection\u003e -\u003e \u003cnatsws.Proxy\u003e -\u003e WebSocket Endpoint`\n\nThis allows the nats communication to be on the same host:port where the go-app is served.\n\nIncrementing the echo counter in the original was replaced with a client http get to `/echo/username`.\n\nInterestingly, this led to the discovery of the nats client connection option `nats.InProcessServer`.\n\nA disconnect test was added to simulate the backend disconnecting the websocket.\n\n### Disclaimers\n\n* See readme in [goapp-natsws](https://github.com/mlctrez/goapp-natsws)\n* As pointed out, this seems like a bit like re-inventing the wheel.\n    * This is not intended to replace the built-in nats websocket client with all of its fail over / cluster\n      capabilities. \n    * Use the default nats client if that's needed.\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/mlctrez/go-nats-app)](https://goreportcard.com/report/github.com/mlctrez/go-nats-app)\n\ncreated by [tigwen](https://github.com/mlctrez/tigwen)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlctrez%2Fgo-nats-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmlctrez%2Fgo-nats-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlctrez%2Fgo-nats-app/lists"}