{"id":19260755,"url":"https://github.com/bhawanihmh/hoverfly-spring-boot-boltdb","last_synced_at":"2026-03-02T05:03:49.349Z","repository":{"id":120015348,"uuid":"141417966","full_name":"bhawanihmh/Hoverfly-Spring-Boot-BoltDB","owner":"bhawanihmh","description":"Implementations of Hoverfly proxy in Spring Boot using Bolt db. ","archived":false,"fork":false,"pushed_at":"2018-08-29T11:35:46.000Z","size":19,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-23T18:31:35.408Z","etag":null,"topics":["bolt","boltdb","hoverfly","hoverfly-boltdb","hoverfly-springboot","hoverflyexample","spring-boot-hoverfly-boltdb","spring-hoverfly-boltdb","springboot-hoverfly","springboot-hoverfly-boltdb","springboot-hoverflyexample"],"latest_commit_sha":null,"homepage":null,"language":null,"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/bhawanihmh.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":"2018-07-18T10:13:06.000Z","updated_at":"2018-08-29T11:35:47.000Z","dependencies_parsed_at":"2023-06-14T17:30:42.522Z","dependency_job_id":null,"html_url":"https://github.com/bhawanihmh/Hoverfly-Spring-Boot-BoltDB","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bhawanihmh/Hoverfly-Spring-Boot-BoltDB","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhawanihmh%2FHoverfly-Spring-Boot-BoltDB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhawanihmh%2FHoverfly-Spring-Boot-BoltDB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhawanihmh%2FHoverfly-Spring-Boot-BoltDB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhawanihmh%2FHoverfly-Spring-Boot-BoltDB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bhawanihmh","download_url":"https://codeload.github.com/bhawanihmh/Hoverfly-Spring-Boot-BoltDB/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhawanihmh%2FHoverfly-Spring-Boot-BoltDB/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29993075,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T01:47:34.672Z","status":"online","status_checked_at":"2026-03-02T02:00:07.342Z","response_time":60,"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":["bolt","boltdb","hoverfly","hoverfly-boltdb","hoverfly-springboot","hoverflyexample","spring-boot-hoverfly-boltdb","spring-hoverfly-boltdb","springboot-hoverfly","springboot-hoverfly-boltdb","springboot-hoverflyexample"],"created_at":"2024-11-09T19:22:46.454Z","updated_at":"2026-03-02T05:03:49.317Z","avatar_url":"https://github.com/bhawanihmh.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# SpringBoot Hoverfly BoltDB\nImplementations of Hoverfly proxy in Spring Boot using Bolt DB. \u003cbr /\u003e\n\n## Install Hoverfly on MacOS\n\n**brew install SpectoLabs/tap/hoverfly** \u003cbr /\u003e\nMore : http://hoverfly.readthedocs.io/en/latest/pages/introduction/downloadinstallation.html\u003cbr /\u003e\n\n## Install Bolt DB\n\n**go get github.com/boltdb/bolt/...** \u003cbr /\u003e\nMore :  https://github.com/boltdb/boltd\u003cbr /\u003e\n\n## Hoverfly commands\n\n**Hoverfly behind a proxy**\u003cbr /\u003e\nhoverctl start --upstream-proxy http://corp.proxy:8080\u003cbr /\u003e\n\n**Upstream proxy authentication**\u003cbr /\u003e\nhoverctl start --upstream-proxy http://my-user:my-pass@corp.proxy:8080\u003cbr /\u003e\n\n**Controlling a remote Hoverfly instance with hoverctl**\u003cbr /\u003e\n\nhoverfly -ap 8880 -pp 8555\u003cbr /\u003e\n\nOn your local machine, you can create a target named remote using hoverctl. This target will be configured to communicate with Hoverfly.\u003cbr /\u003e\n\nhoverctl targets create remote \\\n    --host hoverfly.example.com \\\n    --admin-port 8880 \\\n    --proxy-port 8555\u003cbr /\u003e\n    \nNow that hoverctl knows the location of the remote Hoverfly instance, run the following commands on your local machine to capture and simulate a URL using this instance:\u003cbr /\u003e\n\nhoverctl -t remote mode capture\u003cbr /\u003e\ncurl --proxy http://hoverfly.example.com:8555 http://ip.jsontest.com\u003cbr /\u003e\nhoverctl -t remote mode simulate\u003cbr /\u003e\ncurl --proxy http://hoverfly.example.com:8555 http://ip.jsontest.com\u003cbr /\u003e\n\nYou will now need to specify the remote target every time you want to interact with this Hoverfly instance. If you are only working with this remote instance, you can set it to be the default target instance for hoverctl.\u003cbr /\u003e\n\nhoverctl targets default remote\u003cbr /\u003e\n\nHow can I view the Hoverfly logs?\u003cbr /\u003e\nhoverctl logs\n\n**Why am I not able to access my Hoverfly remotely?**\nThat’s because Hoverfly is bind to loopback interface by default, meaning that you can only access to it on localhost. To access it remotely, you can specify the IP address it listens on. For example, setting 0.0.0.0 to listen on all network interfaces.\u003cbr /\u003e\n\nhoverfly -listen-on-host 0.0.0.0 \u003cbr /\u003e\n\n**hoverfly -ap 8880 -pp 8555 -listen-on-host XXX.XXX.XXX.XXX -db \"boltdb\" -db-path ~/sample.db** \u003cbr /\u003e\n\nINFO[2018-07-18T15:24:22+05:30] Default proxy port has been overwritten       port=8555\u003cbr /\u003e\nINFO[2018-07-18T15:24:22+05:30] Default admin port has been overwritten       port=8880\u003cbr /\u003e\nINFO[2018-07-18T15:24:22+05:30] Listen on specific interface                  host=XXX.XXX.XXX.XXX\u003cbr /\u003e\nINFO[2018-07-18T15:24:22+05:30] Initiating database                           databaseName=/Users/bhawani.s.shekhawat/sample.db\u003cbr /\u003e\nINFO[2018-07-18T15:24:22+05:30] Using boltdb backend \u003cbr /\u003e                        \nINFO[2018-07-18T15:24:22+05:30] Proxy prepared...                             Destination=. Mode=simulate ProxyPort=8555\u003cbr /\u003e\nINFO[2018-07-18T15:24:22+05:30] current proxy configuration                   destination=. mode=simulate port=8555\u003cbr /\u003e\nINFO[2018-07-18T15:24:22+05:30] Admin interface is starting...                AdminPort=8880\u003cbr /\u003e\nINFO[2018-07-18T15:24:22+05:30] serving proxy \u003cbr /\u003e\n\n## SpringBoot changes:\n\nimport org.springframework.http.client.SimpleClientHttpRequestFactory;\u003cbr /\u003e\nimport java.net.InetSocketAddress;\u003cbr /\u003e\nimport java.net.Proxy;\u003cbr /\u003e\nimport java.net.Proxy.Type;\u003cbr /\u003e\n\nRestTemplate restTemplate = new RestTemplate();\u003cbr /\u003e\nSimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();\u003cbr /\u003e\nProxy proxy = new Proxy(Type.HTTP, new InetSocketAddress(\"XXX.XXX.XXX.XXX\", 8555));\u003cbr /\u003e\nrequestFactory.setProxy(proxy);\u003cbr /\u003e\nrestTemplate =  new RestTemplate(requestFactory);\u003cbr /\u003e\nProgramme programme = restTemplate.getForObject(\"http://127.0.0.1:8091/programme/{id}\", Programme.class, programId);\u003cbr /\u003e\n\n## Using middleware:\u003cbr /\u003e\nHoverfly middleware can be written in any language. Middleware modules receive a service data JSON string via the standard input (STDIN) and must return a service data JSON string to the standard output (STDOUT).\u003cbr /\u003e\nTo implement more dynamic behaviour, middleware should be combined with Hoverfly's synthesize mode (see the Creating synthetic services section).\u003cbr/\u003e\n### Javascript example\u003cbr /\u003e\nThis example will change the response code and body in each response.\u003cbr/\u003e\nEnsure that you have captured some traffic with Hoverfly\u003cbr/\u003e\nEnsure that you have NodeJS installed\u003cbr/\u003e\nSave the following code into a file named example.js and make it executable (chmod +x example.js):\u003cbr/\u003e\n #!/usr/bin/env node\u003cbr/\u003e\n\n process.stdin.resume(); \u003cbr/\u003e \n process.stdin.setEncoding('utf8');\u003cbr/\u003e  \n process.stdin.on('data', function(data) {\u003cbr/\u003e\n   var parsed_json = JSON.parse(data);\u003cbr/\u003e\n   // changing response\u003cbr/\u003e\n   parsed_json.response.status = 201;\u003cbr/\u003e\n   parsed_json.response.body = \"body was replaced by JavaScript middleware\\n\";\u003cbr/\u003e\n\u003cbr/\u003e\n   // stringifying JSON response\u003cbr/\u003e\n   var newJsonString = JSON.stringify(parsed_json);\u003cbr/\u003e\n\u003cbr/\u003e\n   process.stdout.write(newJsonString);\u003cbr/\u003e\n });\u003cbr/\u003e\nRestart Hoverfly in simulate mode with the example.js script specified as middleware:\u003cbr/\u003e\n   ./hoverfly -middleware \"./example.js\"\u003cbr/\u003e\nRepeat the steps you took to capture the traffic You will notice that every response will have the 201 status code,\u003cbr/\u003e and the body will have been replaced by the string specified in the script.\u003cbr/\u003e\n\u003cbr/\u003e\n\n\n## More about Hoverfly:\u003cbr /\u003e\nhttps://hoverfly.readthedocs.io/en/latest/pages/tutorials/advanced/advanced.html \u003cbr /\u003e\n\n## hoverctl commands:\u003cbr /\u003e\nhttps://hoverfly.readthedocs.io/en/latest/pages/reference/hoverctl/hoverctlcommands.html#hoverctl-commands\u003cbr /\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhawanihmh%2Fhoverfly-spring-boot-boltdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbhawanihmh%2Fhoverfly-spring-boot-boltdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhawanihmh%2Fhoverfly-spring-boot-boltdb/lists"}