{"id":13583697,"url":"https://github.com/SuperMarcus/airprint-proxy","last_synced_at":"2025-04-06T21:32:47.552Z","repository":{"id":50954329,"uuid":"109904904","full_name":"SuperMarcus/airprint-proxy","owner":"SuperMarcus","description":"Advertise AirPrint printers for network printers located outside the subnet using node. GPL-3.0 licensed.","archived":false,"fork":false,"pushed_at":"2021-05-26T21:09:33.000Z","size":398,"stargazers_count":31,"open_issues_count":4,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-31T08:12:03.556Z","etag":null,"topics":["airprint","bonjour","dns-sd","mdns","network-printer"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/airprint-proxy","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SuperMarcus.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}},"created_at":"2017-11-07T23:53:47.000Z","updated_at":"2025-01-15T01:06:20.000Z","dependencies_parsed_at":"2022-08-28T13:10:43.801Z","dependency_job_id":null,"html_url":"https://github.com/SuperMarcus/airprint-proxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperMarcus%2Fairprint-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperMarcus%2Fairprint-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperMarcus%2Fairprint-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperMarcus%2Fairprint-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SuperMarcus","download_url":"https://codeload.github.com/SuperMarcus/airprint-proxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247556224,"owners_count":20957926,"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":["airprint","bonjour","dns-sd","mdns","network-printer"],"created_at":"2024-08-01T15:03:42.555Z","updated_at":"2025-04-06T21:32:47.297Z","avatar_url":"https://github.com/SuperMarcus.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"AirPrint Proxy\n==============\n\n```\n____ _ ____ ___  ____ _ _  _ ___    ___  ____ ____ _  _ _   _ \n|__| | |__/ |__] |__/ | |\\ |  |     |__] |__/ |  |  \\/   \\_/  \n|  | | |  \\ |    |  \\ | | \\|  |     |    |  \\ |__| _/\\_   |\n```\n\n[![Build Status](https://travis-ci.org/SuperMarcus/airprint-proxy.svg?branch=master)](https://travis-ci.org/SuperMarcus/airprint-proxy)\n[![npm version](https://badge.fury.io/js/airprint-proxy.svg)](https://badge.fury.io/js/airprint-proxy)\n\n[![NPM](https://nodei.co/npm/airprint-proxy.png)](https://nodei.co/npm/airprint-proxy/)\n\nAdvertise AirPrint printers for network printers located outside the\nsubnet using node. GPL-3.0 licensed.\n\n![It's Working!](its_working_screenshot.jpg)\n\n    Copyright (C) 2017 Marcus Zhou\n    \n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n    \n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n    \n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n\n## Introduction\n\nThis library provides the ability to create a A record which points to\nan external printer's ip address, and advertise that printer as a\nAirPrint supported printer. The only parameters really needed to setup\nis the ip address.\n\nThis library can also be used in scenario like the printer is located\nin another room under a specific subnet that can be reached by ip address\nbut cannot be reached by multicast packets like mdns. By running this\nproxy on a device located inside the localnet, the phones and computers\nshould be able to discover the printers.\n\n**Node: The remote printer needs to support the MIME type `image/urf`**\n\nThe library does not provide any kind of translation functions that\nconverts the Apple Raster format to others, which requires the remote\nprinting server to natively support the format.\n\n## Requirements \u0026 Compatibility\n\n`airprint-proxy` requires node version greater or equal 8.3.0 to run.\n\n`airprint-proxy` is compatible with node 10.\n\n## Setup\n\nInstall as global package:\n```sh\n# For npm users\nnpm install -g airprint-proxy\n\n# For yarn users\nyarn global add airprint-proxy\n```\n\nInstall as dependency:\n\n```sh\n# For npm users\nnpm install airprint-proxy\n\n# For yarn users\nyarn add airprint-proxy\n```\n\n## Usage\n\nAirPrint Proxy comes with both Command Line Interface (CLI)\nand programmable APIs.\n\n### Commands\n\nInstall AirPrint Proxy as global package to use the command.\n(See the section above)\n\n```\nUsage: airprint-proxy [...options] \u003curl|ip\u003e\n```\n\nAvailable options\n\n| Short | Full           | Description                                                               | Default Value              |\n| ----- | -------------- | ------------------------------------------------------------------------- | -------------------------- |\n| `-p`  | `--port`       | The port of the printing server that clients will be connect to           | 631                        |\n| `-n`  | `--name`       | The name of the printer that will be broadcasts to the local network      | \"Untitled Bonjour Printer\" |\n| `-l`  | `--location`   | The notes which will be shown as the location of the printer              | \"\"                         |\n| `-q`  | `--queue`      | The queue on the printing server which clients will be communicating with | \"ipp/print\"                |\n| `-c`  | `--color`      | Broadcast this printer as a color printer                                 | false                      |\n| `-d`  | `--duplex`     | Broadcast this printer as duplex supported                                | false                      |\n| `-m`  | `--mime-types` | Specify additional supported MIME types beside 'image/urf'.               |                            |\n| `-o`  | `--txt-record` | Add additional txt records. (E.g. -o you=me)                              |                            |\n| `-h`  | `--help`       | Show help message                                                         |                            |\n| `-a`  | `--automatic`  | Automatically resolve and configure printer from ip address               | false                      |\n\nExamples\n\n```sh\n# Automatically resolve the printer's name and capabilities from its ip address\nairprint-proxy -a 10.35.0.18\n\n# Broadcast a remote printer at 10.35.0.18 (without asking the printer what it can do)\nairprint-proxy 10.35.0.18\n\n# Broadcast the same printer with name \"Library Color\"\nairprint-proxy --name \"Library Color\" 10.35.0.18\n\n# Broadcast the same printer with name \"US Commons\" and location \"Upper School 1st Floor\"\nairprint-proxy --name \"Library Color\" --location \"Upper School 1st Floor\" 10.35.0.18\n```\n\n### APIs\n\nThe `PrinterProxy` object is setup to manage all mdns requests, so be\nsure to instantiate one every time.\n\n```JavaScript\n//CommonJS style\nconst APProxy = require(\"airprint-proxy\");\nconst PrinterProxy = APProxy.PrinterProxy;\nconst Printer = APProxy.Printer;\n\n//ES6 style\nimport { PrinterProxy, Printer } from \"airprint-proxy\";\n\nlet proxy = new PrinterProxy();\n```\n\nUse `Printer` to represent each printer.\n\n```JavaScript\n//This is the complex way\nlet printer = new Printer(\n    \"10.35.0.18\",            //IP Address \u003crequired\u003e\n    \"Library Color Printer\", //Name \u003coptional\u003e\n    631,                     //Port \u003coptional\u003e\n    \"Media Center\",          //Notes, will be displayed as Location \u003coptional\u003e\n    \"library-color.local\"    //A proper hostname, make sure it is not duplicated \u003coptional\u003e\n);\n\n//Use URL to specify queue and include everything\nlet printer2 = new Printer(\n    \"ipp://10.20.0.95:631/ipp/print\",\n     \"US Life Center\",\n     \"Upper School 1st Floor\");\n\n//Or you can just give the ip address, the name will be set to like\n// Untitled Bonjour Printer 10341\nlet anotherPrinter = new Printer(\"10.20.0.92\");\n\n//Add the printers to make proxy publish those printers\nproxy.addPrinter(printer);\nproxy.addPrinter(printer2);\nproxy.addPrinter(anotherPrinter);\n```\n\nAs of `1.2.0`, you can let `PrinterProxy` automatically resolve the name and capabilities of the\nprinter on a remote server supporting unicast dns service discovery. (e.g. a cups server)\n\nYou may need to adjust your printer's firewall \u0026 mdns responder settings to allow dns sd queries\nfrom your address.\n\n```JavaScript\n//Resolve the printers broadcasting on 10.35.0.18\nproxy.resolvePrinter(\"10.35.0.18\");\n\n//The optional callback function accepted in the second argument\nproxy.resolvePrinter(\"10.35.0.18\", (error, resolvedPrinters) =\u003e {\n    //The 'error' parameter is null when successfully resolved the\n    // printer, and an 'Error' object on error\n    if(error){\n        console.error(\"Error resolving printer\", error);\n    }\n    \n    //The 'resolvedPrinters' parameter is null when an error occurred.\n    // An array of 'Printer' object on success\n})\n```\n\nSee `src/test.js` for more examples.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSuperMarcus%2Fairprint-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSuperMarcus%2Fairprint-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSuperMarcus%2Fairprint-proxy/lists"}