{"id":22042977,"url":"https://github.com/jmoney/fastly-websocket-poc","last_synced_at":"2026-04-20T05:36:09.174Z","repository":{"id":186183191,"uuid":"674721507","full_name":"jmoney/fastly-websocket-poc","owner":"jmoney","description":"POC project demonstrating a fastly vcl service using websockets","archived":false,"fork":false,"pushed_at":"2024-01-01T03:03:06.000Z","size":1240,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-13T09:53:48.851Z","etag":null,"topics":["fastly","github-site","license-management","mkdocs"],"latest_commit_sha":null,"homepage":"https://www.jmoney.dev/fastly-websocket-poc","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jmoney.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":"2023-08-04T15:51:44.000Z","updated_at":"2023-09-29T03:03:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"c3588c16-5ecf-4f52-8298-ae8dbbbc3f35","html_url":"https://github.com/jmoney/fastly-websocket-poc","commit_stats":null,"previous_names":["jmoney/fastly-websocket-poc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jmoney/fastly-websocket-poc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmoney%2Ffastly-websocket-poc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmoney%2Ffastly-websocket-poc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmoney%2Ffastly-websocket-poc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmoney%2Ffastly-websocket-poc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmoney","download_url":"https://codeload.github.com/jmoney/fastly-websocket-poc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmoney%2Ffastly-websocket-poc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32034960,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["fastly","github-site","license-management","mkdocs"],"created_at":"2024-11-30T12:13:55.748Z","updated_at":"2026-04-20T05:36:09.152Z","avatar_url":"https://github.com/jmoney.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fastly-websocket-poc\n\n## Deploy\n\nFirst run the following commands\n\n```bash\nbrew bundle --file Brewfile\nngrok start --all --config ngrok.yml\n```\n\nThis will start ngrok and expose `localhost:9001` and `localhost:9002` to the internet.  Then you need to update the local variables in `main.tf` to the outputted ngrok urls.\n\nNow in two separate tabs of your terminal run the following commands:\n\n```bash\necho-server --port 9001 --type http\necho-server --port 9002 --type websocket\n```\n\nThis starts two echo servers on addresses `localhost:9001` and `localhost:9002`.  The first is a simple http server that returns the request headers.  The second is a websocket server that echos back the message sent to it.\n\nThe fastly service is deployed using terraform. The terraform script is `main.tf`. The main decision is which type of fastly service to deploy: vcl or compute.  If vcl is chose, then a deliver service managed by vcl will be deployed.  If compute is chose, then a compute serivice written in golang is to be deployed.  To deploy the service, run the following commands:\n\n```bash\n# vcl based service\ntfenv use\nterraform init\nmake apply-vcl\n```\n\n```bash\n# compute based service\ntfenv use\nterraform init\nmake apply-compute\n```\n\nThis does a terraform apply with the state generated locally. This is currently using cloudflare as the DNS provider.  Please set the `tld` terraform variable to tld you own and have access too in cloudflare.  Cloudflare was used for demo purposes it can be replaced with any DNS provider supported by terraform such as AWS Route53.\n\n### Providers used\n\n* [Cloudflare](https://registry.terraform.io/providers/cloudflare/cloudflare/4.11.0/docs)\n* [Fastly](https://registry.terraform.io/providers/fastly/fastly/5.2.2/docs)\n\n## Test\n\nOnce deployed you can run the following test to see this in action:\n\n```bash\ncurl --silent \"https://echo.jmoney.dev/http\"\nwebsocat \"wss://echo.jmoney.dev/websocket\"\n```\n\nAfter the first command you'll see an echoed response as well as some logging in the echo-server terminal tab.  After the second command, you'll need to type some text and hit enter and then you'll see the an echoed response as well as some logging in the echo-server terminal tab.  This shows that the websocket connection is being upgraded and the websocket server is receiving the message.\n\n## Cleanup\n\nWhen testing is complete do not forget to tear it all down. To do so run the following command:\n\n```bash\n# cleanup vcl based service\ntfenv use\nterraform init\nmake destroy-vcl\n```\n\n```bash\n# cleanup compute based service\ntfenv use\nterraform init\nmake destroy-compute\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmoney%2Ffastly-websocket-poc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmoney%2Ffastly-websocket-poc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmoney%2Ffastly-websocket-poc/lists"}