{"id":17332589,"url":"https://github.com/jtolio/crawlspace","last_synced_at":"2025-07-13T01:36:28.139Z","repository":{"id":57510025,"uuid":"43235586","full_name":"jtolio/crawlspace","owner":"jtolio","description":"If enabled, allows live debug scripting of a running process's Go objects and types over a TCP socket.","archived":false,"fork":false,"pushed_at":"2024-05-21T19:34:44.000Z","size":60,"stargazers_count":16,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-16T14:58:09.420Z","etag":null,"topics":["debugging","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jtolio.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":"2015-09-27T05:24:40.000Z","updated_at":"2024-09-29T10:57:53.000Z","dependencies_parsed_at":"2022-09-26T17:01:01.571Z","dependency_job_id":"d100b867-08d4-4c1e-a69d-cc333cfa38bf","html_url":"https://github.com/jtolio/crawlspace","commit_stats":null,"previous_names":["jtolds/go-manhole","jtolio/crawlspace","jtolio/go-manhole"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtolio%2Fcrawlspace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtolio%2Fcrawlspace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtolio%2Fcrawlspace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtolio%2Fcrawlspace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jtolio","download_url":"https://codeload.github.com/jtolio/crawlspace/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221832531,"owners_count":16888265,"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":["debugging","go","golang"],"created_at":"2024-10-15T14:58:14.842Z","updated_at":"2024-10-28T13:35:21.722Z","avatar_url":"https://github.com/jtolio.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# crawlspace\n\nhttps://pkg.go.dev/github.com/jtolio/crawlspace\n\npackage crawlspace provides a means to dynamically interact with registered Go\nobjects in a live process, using small scripting language based around the\nreflect package.\n\nInspiration is mainly from Twisted's manhole library:\nhttps://twistedmatrix.com/documents/current/api/twisted.conch.manhole.html\n\nExample usage:\n\n```\npackage main\n\nimport (\n\t\"github.com/jtolds/crawlspace\"\n)\n\ntype MyType struct{ x int }\n\nfunc (m *MyType) Set(x int) { m.x = x }\nfunc (m *MyType) Get() int  { return m.x }\n\nfunc main() {\n\tspace := crawlspace.New(nil)\n\tspace.RegisterVal(\"x\", \u0026MyType{})\n\tpanic(crawlspace.ListenAndServe(\"localhost:2222\"))\n}\n```\n\nAfter running the above program, you can now connect via telnet or netcat\nto localhost:2222, and run the following interaction:\n\n```\n\u003e x.Get()\n0\n\u003e x.Set(5)\n\u003e x.Get()\n5\n```\n\nIf you import the `github.com/jtolds/crawlspace/tools` package, you can have an\nextremely powerful experience that doesn't require type registration, driven by\nhttps://github.com/zeebo/goof.\n\n```\n\tspace := crawlspace.New(tools.Env)\n```\n\nAnd here's an example history inspecting a process:\n\n```\nTrying 127.0.0.1...\nConnected to localhost.\nEscape character is '^]'.\ngithub.com/jtolio/crawlspace@v0.0.0-20231013070742-9283b10c8cf6\ngithub.com/jtolio/crawlspace-test@(devel)\n\u003e import \"net\"\n\u003e import \"reflect\"\n\u003e import \"unsafe\"\n\u003e conn := reflect.NewAt(net.conn, unsafe.Pointer(uintptr(0xc00028e038))).Interface()\n\u003e dir(conn)\n[]string{\"Close\", \"File\", \"LocalAddr\", \"Read\", \"RemoteAddr\", \"SetDeadline\", \"SetReadBuffer\", \"SetReadDeadline\", \"SetWriteBuffer\", \"SetWriteDeadline\", \"Write\", \"fd\"}\n\u003e addr := conn.RemoteAddr()\n\u003e addr.String()\n\"127.0.0.1:43868\"\n\u003e dir(addr)\n[]string{\"AddrPort\", \"IP\", \"Network\", \"Port\", \"String\", \"Zone\"}\n\u003e ips, err := net.LookupIP(\"google.com\")\n\u003e err\nnil\n\u003e ips[1].String()\n\"172.217.2.46\"\n\u003e\n```\n\nCopyright 2015-2023, JT Olds. Licensed under Apache License 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtolio%2Fcrawlspace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjtolio%2Fcrawlspace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtolio%2Fcrawlspace/lists"}