{"id":20962201,"url":"https://github.com/developerdizzle/sockpuppet","last_synced_at":"2025-12-26T09:29:05.380Z","repository":{"id":90655415,"uuid":"4721937","full_name":"developerdizzle/SockPuppet","owner":"developerdizzle","description":"Use websockets to link a c# object to a javascript object, and call javascript object methods from your c# strongly typed interface or dynamic object","archived":false,"fork":false,"pushed_at":"2012-06-22T23:36:34.000Z","size":520,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-20T00:53:43.406Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","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/developerdizzle.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}},"created_at":"2012-06-20T03:30:04.000Z","updated_at":"2015-02-20T05:30:06.000Z","dependencies_parsed_at":"2023-02-28T04:10:38.603Z","dependency_job_id":null,"html_url":"https://github.com/developerdizzle/SockPuppet","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/developerdizzle%2FSockPuppet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developerdizzle%2FSockPuppet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developerdizzle%2FSockPuppet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developerdizzle%2FSockPuppet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/developerdizzle","download_url":"https://codeload.github.com/developerdizzle/SockPuppet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243358306,"owners_count":20277995,"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-19T02:24:19.987Z","updated_at":"2025-12-26T09:29:00.359Z","avatar_url":"https://github.com/developerdizzle.png","language":"C#","readme":"#SockPuppet\r\n\r\nLink a .NET object to a Javascript object using HTML5 WebSockets, and call Javascript object methods from your .NET code.\r\n\r\nOn your web page:\r\n\r\n    //create a new WebSocket object as usual\r\n    var server = new WebSocket(\"ws://localhost:8181\");\r\n\r\n    //set our context to the window object - all sockpuppet method calls will be performed on this object\r\n    server.puppetContext(window);\r\n\r\n\r\nIn your server-side code:\r\n\r\n    //create a dynamic Sockpuppet, passing a Func\u003cstring\u003e used to send a message through your Websocket\r\n    dynamic dynamicPuppet = SockPuppet.Puppet.New(r =\u003e socket.Send(r));\r\n\r\n    //call any method on your client-side context object!\r\n    dynamicPuppet.document.alert(\"I'm in your browser calling your methods!\");\r\n    \r\nAlso supports interfaces (that do not have to be explicitly implemented!):\r\n\r\n    //create a strongly typed sockpuppet\r\n    IClientWindow windowPuppet = SockPuppet.Puppet.New\u003cIClientWindow\u003e(r =\u003e socket.Send(r));\r\n    \r\n    //call any method on your client-side context object!\r\n    windowPuppet.showMessage(\"This method was called from an interface on the server!\");\r\n    \r\nThe demo uses Fleck as a Websocket server, but you are free to use whichever you prefer.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloperdizzle%2Fsockpuppet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeveloperdizzle%2Fsockpuppet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloperdizzle%2Fsockpuppet/lists"}