{"id":21304752,"url":"https://github.com/nrepl/drawbridge","last_synced_at":"2025-12-12T01:27:59.986Z","repository":{"id":2857324,"uuid":"3861954","full_name":"nrepl/drawbridge","owner":"nrepl","description":"An HTTP/HTTPS nREPL transport, implemented as a Ring handler.","archived":false,"fork":false,"pushed_at":"2020-05-25T11:12:10.000Z","size":67,"stargazers_count":183,"open_issues_count":9,"forks_count":16,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-10-29T23:59:56.728Z","etag":null,"topics":["clojure","nrepl","nrepl-transport"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"johnagan/clean-webpack-plugin","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nrepl.png","metadata":{"files":{"readme":"README.adoc","changelog":"CHANGELOG.adoc","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-03-29T02:45:55.000Z","updated_at":"2024-06-29T20:04:23.000Z","dependencies_parsed_at":"2022-09-14T08:01:44.554Z","dependency_job_id":null,"html_url":"https://github.com/nrepl/drawbridge","commit_stats":null,"previous_names":["cemerick/drawbridge"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nrepl%2Fdrawbridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nrepl%2Fdrawbridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nrepl%2Fdrawbridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nrepl%2Fdrawbridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nrepl","download_url":"https://codeload.github.com/nrepl/drawbridge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247166168,"owners_count":20894654,"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":["clojure","nrepl","nrepl-transport"],"created_at":"2024-11-21T16:15:51.866Z","updated_at":"2025-12-12T01:27:59.935Z","avatar_url":"https://github.com/nrepl.png","language":"HTML","readme":"= Drawbridge (HTTP Transport for nREPL)\nBozhidar Batsov \u003chttps://github.com/bbatsov\u003e\n\n// Settings:\n:idprefix:\n:idseparator: -\nifndef::env-github[:icons: font]\nifdef::env-github,env-browser[]\n:toc: preamble\n:toclevels: 1\nendif::[]\nifdef::env-github[]\n:status:\n:!toc-title:\n:note-caption: :paperclip:\n:tip-caption: :bulb:\nendif::[]\n\nimage:https://img.shields.io/clojars/v/nrepl/drawbridge.svg[Clojars Project,link=https://clojars.org/nrepl/drawbridge]\nimage:https://cljdoc.xyz/badge/nrepl/drawbridge[cljdoc badge,link=https://cljdoc.org/d/nrepl/drawbridge/CURRENT]\nimage:https://travis-ci.org/nrepl/drawbridge.png?branch=master[Build Status (Travis CI),link=https://travis-ci.org/nrepl/drawbridge]\n\nHTTP transport support for Clojure's\nhttp://github.com/nrepl/nrepl[nREPL] implemented as a\nhttp://github.com/ring-clojure/ring[Ring] handler.\n\n== Installation\n\nNOTE: The coordinates of the project changed from `cemerick/drawbridge` to\n`nrepl/drawbridge` in version 0.1.\n\nDrawbridge is available in Clojars. Add this `:dependency` to your Leiningen\n`project.clj`:\n\n[source,clojure]\n----\n[nrepl/drawbridge \"0.2.1\"]\n----\n\nOr, add this to your Maven project's `pom.xml`:\n\n[source,xml]\n----\n\u003crepository\u003e\n  \u003cid\u003eclojars\u003c/id\u003e\n  \u003curl\u003ehttp://clojars.org/repo\u003c/url\u003e\n\u003c/repository\u003e\n\n\u003cdependency\u003e\n  \u003cgroupId\u003enrepl\u003c/groupId\u003e\n  \u003cartifactId\u003edrawbridge\u003c/artifactId\u003e\n  \u003cversion\u003e0.2.1\u003c/version\u003e\n\u003c/dependency\u003e\n----\n\nNOTE: Drawbridge is compatible with Clojure 1.7.0+ and nREPL 0.4+.\n\n=== Upgrade notes\n\nIf you're upgrading from 0.0.7 keep in mind that the namespaces of the\nproject were changed as following:\n\n* `cemerick.drawbridge` \\-\u003e `drawbridge.core`\n* `cemerick.drawbridge.client` \\-\u003e `drawbridge.client`\n\n== Usage\n\nWhile nREPL provides a solid REPL backend for Clojure, typical\nsocket-based channels are often unsuitable.  Being able to deploy\napplications that allow for REPL access via HTTP and HTTPS simplifies\nconfiguration and can alleviate security concerns, and works around\nlimitations in various deployment environments where traditional\nsocket-based channels are limited or entirely unavailable.\n\n=== In a Ring web application\n\nOnce you have added Drawbridge to your project's dependencies, just\nadd its Ring handler to your application.  For example, if you're using\nhttps://github.com/weavejester/compojure[Compojure] for routing and\nsuch:\n\n[source,clojure]\n----\n(require 'drawbridge.core)\n\n(let [nrepl-handler (drawbridge.core/ring-handler)]\n  (ANY \"/repl\" request (nrepl-handler request)))\n----\n\nWith this, any HTTP or HTTPS client can send nREPL messages to the\n`/repl` URI, and read responses from the same.  Conveniently, any\nsecurity measures applied within your application will work fine in\nconjunction with Drawbridge; so, if you configure its route to require\nauthentication or authorization to some application-specific role, those\nprerequisites will apply just as with any other Ring handler in the same\ncontext.\n\nSome things to be aware of when using `drawbridge.core/ring-handler`:\n\n* It requires `GET` and `POST` requests\nto be routed to whatever URI to which it is mapped; other request\nmethods result in an HTTP error response.\n* It requires these standard Ring middlewares to function properly:\n ** `keyword-params`\n ** `nested-params`\n ** `wrap-params`\n\nEspecially if you are going to be connecting to your webapp's nREPL\nendpoint with a client that uses Drawbridge's own HTTP/HTTPS client\ntransport (see below), this is all you need to know.\n\nIf you are interested in the implementation details and semantics,\nperhaps because you'd like to implement support for Drawbridge in\nnon-Clojure nREPL clients, you'll want to review the documentation for\n`ring-handler`, which contains additional important details.\n\n=== In Clojure tooling\n\nDrawbridge also provides a client-side nREPL transport implementation\nfor the Ring handler in `drawbridge.client/ring-client-transport`.\n\nNote that the `drawbridge.client` namespace implicitly adds\nimplementations to the `nrepl.core/url-connect` multimethod for\n`\"http\"` and `\"https\"` schemes. So, once this namespace is loaded, any\ntool that uses `url-connect` will use `ring-client-transport` for\nconnecting to HTTP and HTTPS nREPL endpoints.\n\n=== Configuration\n\nThe client supports additional HTTP headers, which is useful e.g. for\nusing Bearer authorization to connect to the endpoint. The headers can\nbe set in the nREPL configuration. For example, create `.nrepl.edn` in\nthe working directory with the contents:\n\n[source,clojure]\n----\n{:drawbridge {:http-headers {:Authorization \"Bearer \u003cJWT token\u003e\"}}}\n----\n\n== TODO\n\nThe biggest outstanding issues are around the semantics of how HTTP\nsession (might optionally) map onto nREPL sessions.  Right now, they\ndon't at all, though HTTP sessions _are_ significant insofar as they\nretain the message queue nREPL will dispatch responses to that are\nemitted by asynchronous or long-running operations.\n\nSecondarily, supporting nontextual REPL interactions over HTTP has not\nyet been addressed at all.\n\n== Need Help?\n\nThe primary support channel for Drawbridge is the http://clojurians.net/[Clojurians Slack]. Feel\nfree to ask any questions on the `#nrepl` channel there.\n\n== License\n\nCopyright © 2012-2019 Chas Emerick, Bozhidar Batsov and other contributors.\n\nDistributed under the Eclipse Public License, the same as Clojure.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnrepl%2Fdrawbridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnrepl%2Fdrawbridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnrepl%2Fdrawbridge/lists"}