{"id":26965402,"url":"https://github.com/erikvullings/proxy","last_synced_at":"2026-04-26T12:32:32.397Z","repository":{"id":285420217,"uuid":"958077398","full_name":"erikvullings/proxy","owner":"erikvullings","description":"A simple HTTPS proxy service to expose Ollama running on localhost","archived":false,"fork":false,"pushed_at":"2025-03-31T16:26:39.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T17:25:49.449Z","etag":null,"topics":["https-server","ollama","proxy","proxy-server"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erikvullings.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-03-31T15:53:30.000Z","updated_at":"2025-03-31T16:26:42.000Z","dependencies_parsed_at":"2025-03-31T17:25:51.563Z","dependency_job_id":"4df36faf-0c4f-4bda-b1d5-f64e3708ae30","html_url":"https://github.com/erikvullings/proxy","commit_stats":null,"previous_names":["erikvullings/proxy"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/erikvullings/proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikvullings%2Fproxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikvullings%2Fproxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikvullings%2Fproxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikvullings%2Fproxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erikvullings","download_url":"https://codeload.github.com/erikvullings/proxy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erikvullings%2Fproxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32297894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T09:34:17.070Z","status":"ssl_error","status_checked_at":"2026-04-26T09:34:00.993Z","response_time":129,"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":["https-server","ollama","proxy","proxy-server"],"created_at":"2025-04-03T07:21:01.899Z","updated_at":"2026-04-26T12:32:32.380Z","avatar_url":"https://github.com/erikvullings.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ollama proxy service\n\nWhen running Ollama on my localhost, I can use it safely using curl or `web-ui`. However, when exposing the local Ollama instance to a SPA (Single Page Application), such as [Spark](https://tno.github.io/scenario-spark/), it will not work, as a HTTPS browser application is not allowed to access unsafe localhost services.\n\nI've tried wrapping my Ollama service using a tunneling service such as `ngrok`, but `ngrok` did not remove the CORS restrictions that the Ollama endpoint imposes, so that failed too.\n\nFinally, I've written a simple proxy service, which can be run using `bun`, which exposes a simple HTTPS endpoint that a web app can use.\n\n## Prerequisites\n\nYou first need to generate a public key and certificate. The most important aspect is to set the fully qualified domain name, as well as the subject's alternate name, to localhost. On a Mac (and on Windows, using [Chocolatey](https://community.chocolatey.org/packages/mkcert)), the easiest way to do this is to use `mkcert`.\n\n```bash\nbrew install mkcert\nmkcert -install\nmkcert localhost\n```\n\nThis command, when executed in the current folder, should generate two files: the certificate `cert.pem` and the key `key.pem`, both which are read by the proxy service to setup a https connection. In addition, `mkcert` also installs the new certificate in your key store, so your browser will trust it too.\n\n## Running the proxy service\n\n```bash\nbun install # Optionally, to satisfy your IDE by installing the bun types.\nbun run proxy.ts\n```\n\n## Testing the proxy service\n\nTo test it, run the following curl command:\n\n```bash\ncurl https://localhost:3000/v1/chat/completions \\\n    -H \"Content-Type: application/json\" \\\n    -d '{\n        \"model\": \"gemma3\",\n        \"messages\": [\n            {\n                \"role\": \"user\",\n                \"content\": \"Why is the sky blue?\"\n            }\n        ],\n        \"stream\": false\n    }'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferikvullings%2Fproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferikvullings%2Fproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferikvullings%2Fproxy/lists"}