{"id":18464273,"url":"https://github.com/projectdiscovery/freeport","last_synced_at":"2025-04-06T00:08:41.612Z","repository":{"id":62808840,"uuid":"545672165","full_name":"projectdiscovery/freeport","owner":"projectdiscovery","description":"Free listening port from the OS","archived":false,"fork":false,"pushed_at":"2024-11-25T01:50:22.000Z","size":53,"stargazers_count":30,"open_issues_count":2,"forks_count":6,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-03-29T23:08:56.202Z","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/projectdiscovery.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-10-04T19:33:25.000Z","updated_at":"2025-03-24T11:38:31.000Z","dependencies_parsed_at":"2023-11-30T21:25:08.502Z","dependency_job_id":"1f352d17-e8ce-4c19-9380-9c680b7d71c5","html_url":"https://github.com/projectdiscovery/freeport","commit_stats":{"total_commits":15,"total_committers":5,"mean_commits":3.0,"dds":0.6666666666666667,"last_synced_commit":"6aaab6f931766aac8434a584cc2a9037fbb0992b"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Ffreeport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Ffreeport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Ffreeport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Ffreeport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/projectdiscovery","download_url":"https://codeload.github.com/projectdiscovery/freeport/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415967,"owners_count":20935387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-11-06T09:09:18.402Z","updated_at":"2025-04-06T00:08:41.592Z","avatar_url":"https://github.com/projectdiscovery.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# freeport\n\nExtended and revisited version of `https://github.com/phayes/freeport` - Get a free port from the OS.\n\n\n```go\n...\n\ntcpPort, err := freeport.GetFreePort(\"127.0.0.1\", freeport.TCP)\nif err != nil {\n    panic(err)\n}\nfmt.Println(\"TCP port: \", tcpPort.Port)\n\nfmt.Println(\"Multiple ports:\")\n\n// get multiple ports\n// test with TCP\ntcpPorts, err := freeport.GetFreePorts(\"127.0.0.1\", freeport.TCP, 5)\nif err != nil {\n    panic(err)\n}\n\nfor _, port := range tcpPorts {\n    fmt.Println(\"TCP port: \", port.Port)\n}\n\n...\n```\n\noutput:\n```\nSingle port:\nUDP port:  57224\nTCP port:  51655\nMultiple ports:\nTCP port:  51656\nTCP port:  51657\nTCP port:  51658\nTCP port:  51659\nTCP port:  51660\n```\n\n# License\n\nfreeport is distributed under MIT License","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectdiscovery%2Ffreeport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprojectdiscovery%2Ffreeport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectdiscovery%2Ffreeport/lists"}