{"id":18253899,"url":"https://github.com/prempreetbrar/tcpfiledownloader","last_synced_at":"2025-06-21T22:04:01.405Z","repository":{"id":235331147,"uuid":"762467766","full_name":"prempreetbrar/TCPFileDownloader","owner":"prempreetbrar","description":"A program that downloads a file from the Internet given a URL over TCP.","archived":false,"fork":false,"pushed_at":"2024-04-23T00:42:08.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T21:46:27.801Z","etag":null,"topics":["download-file","file-downloader","http","http-client","http-requests","http-response","https","java","network-programming","non-persistent","socket-client","ssl","streams","tcp","tcp-client","tls"],"latest_commit_sha":null,"homepage":"","language":"Java","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/prempreetbrar.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}},"created_at":"2024-02-23T20:59:10.000Z","updated_at":"2024-04-25T01:26:07.000Z","dependencies_parsed_at":"2024-04-23T04:13:23.777Z","dependency_job_id":null,"html_url":"https://github.com/prempreetbrar/TCPFileDownloader","commit_stats":null,"previous_names":["prempreetbrar/tcpfiledownloader"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/prempreetbrar/TCPFileDownloader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prempreetbrar%2FTCPFileDownloader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prempreetbrar%2FTCPFileDownloader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prempreetbrar%2FTCPFileDownloader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prempreetbrar%2FTCPFileDownloader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prempreetbrar","download_url":"https://codeload.github.com/prempreetbrar/TCPFileDownloader/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prempreetbrar%2FTCPFileDownloader/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261200384,"owners_count":23123946,"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":["download-file","file-downloader","http","http-client","http-requests","http-response","https","java","network-programming","non-persistent","socket-client","ssl","streams","tcp","tcp-client","tls"],"created_at":"2024-11-05T10:08:57.899Z","updated_at":"2025-06-21T22:03:56.365Z","avatar_url":"https://github.com/prempreetbrar.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TCP File Downloader\n\nA program that downloads a file from the Internet given a URL over TCP. Watch a gif of me interacting with it below!\n\u003cbr\u003e\u003c/br\u003e\n![photo](https://github.com/prempreetbrar/TCPFileDownloader/assets/89614923/d2f1487f-fdbe-4837-9ac3-bb249496ef39)\n\u0026nbsp;\n\n## Features\n- Supports both `HTTP` and `HTTPS` URLs; if the protocol is `HTTP`, a regular `Socket` is used to establish a TCP connection; if the protocol is `HTTPS`,\n  a secure connection is established with the server using an `SSLSocket`. \n- Operates in non-persistent HTTP mode; once the object is downloaded, the client closes the underlying TCP connection.\n- URLs must be properly formatted with the following syntax: `protocol://hostname[:port]/pathname`, where `protocol` is either HTTP or HTTPS,\n  `hostname` is the name of the web server, `[:port]` is an optional part which specifies the server port (default is 80 for HTTP and 443 for HTTPS),\n  `pathname` is the path of the requested object on the specified host.\n- Reads the server response line by line to first identify the end of the header fields (by looking for `\\r\\n`), and then reads the\n  remainder of the server's response (the file itself) chunk-by-chunk using a buffer for improved performance. \n\n## If you want to start up the project on your local machine:\n1. Download the code as a ZIP:\n\u003cbr\u003e\u003c/br\u003e\n![download](https://github.com/prempreetbrar/TCPFileDownloader/assets/89614923/9fb50273-25c4-45e9-8f30-a388c3cd38cb)\n\u0026nbsp;\n\n3. Unzip the code:\n\u003cbr\u003e\u003c/br\u003e\n![file](https://github.com/prempreetbrar/TCPFileDownloader/assets/89614923/15238822-a37f-43e0-89f5-709719d7f99b)\n\u0026nbsp;\n\n4. Open the folder in an IDE, such as VSCode:\n\u003cbr\u003e\u003c/br\u003e\n![code](https://github.com/prempreetbrar/TCPFileDownloader/assets/89614923/8eeffe74-0bb9-49f9-8e5f-45dbc5af300a)\n\u0026nbsp;\n\n5. Obtain the URL of a file from the internet, copy it. Then, run the code by doing\n   ```javac *.java\n      java ClientDriver -u \u003curl_copied_from_internet\u003e\n   ```\n\u003cbr\u003e\u003c/br\u003e\n  ![photo](https://github.com/prempreetbrar/TCPFileDownloader/assets/89614923/c03f34ad-558d-4665-af01-2a1f7befaa20)\n\u0026nbsp;\n\n6. Interact with the file as you please!\n\u003cbr\u003e\u003c/br\u003e\n![enjoy](https://github.com/prempreetbrar/TCPFileDownloader/assets/89614923/7641c504-2615-41f5-97c1-bf97e5fbaf86)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprempreetbrar%2Ftcpfiledownloader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprempreetbrar%2Ftcpfiledownloader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprempreetbrar%2Ftcpfiledownloader/lists"}