{"action":"created","issue":{"url":"https://api.github.com/repos/atom/electron/issues/3475","labels_url":"https://api.github.com/repos/atom/electron/issues/3475/labels{/name}","comments_url":"https://api.github.com/repos/atom/electron/issues/3475/comments","events_url":"https://api.github.com/repos/atom/electron/issues/3475/events","html_url":"https://github.com/atom/electron/issues/3475","id":117392432,"number":3475,"title":"Protocol docs referer","user":{"login":"frozeman","id":232662,"avatar_url":"https://avatars.githubusercontent.com/u/232662?v=3","gravatar_id":"","url":"https://api.github.com/users/frozeman","html_url":"https://github.com/frozeman","followers_url":"https://api.github.com/users/frozeman/followers","following_url":"https://api.github.com/users/frozeman/following{/other_user}","gists_url":"https://api.github.com/users/frozeman/gists{/gist_id}","starred_url":"https://api.github.com/users/frozeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frozeman/subscriptions","organizations_url":"https://api.github.com/users/frozeman/orgs","repos_url":"https://api.github.com/users/frozeman/repos","events_url":"https://api.github.com/users/frozeman/events{/privacy}","received_events_url":"https://api.github.com/users/frozeman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-17T16:29:36Z","updated_at":"2015-11-17T16:38:43Z","closed_at":null,"body":"https://github.com/atom/electron/blob/master/docs/api/protocol.md\r\n\r\nThe docs talk of a `referee` in `registerHttpProtocol`, i guess this should be `referrer`?\r\n\r\nIt would be relay nice to have more examples, as for example the HTTP protocol \"forwarder\" is not quite clear.\r\n\r\nI assume its allowing rewriting of http calls etc. Its not very clear described."},"comment":{"url":"https://api.github.com/repos/atom/electron/issues/comments/157425419","html_url":"https://github.com/atom/electron/issues/3475#issuecomment-157425419","issue_url":"https://api.github.com/repos/atom/electron/issues/3475","id":157425419,"user":{"login":"frozeman","id":232662,"avatar_url":"https://avatars.githubusercontent.com/u/232662?v=3","gravatar_id":"","url":"https://api.github.com/users/frozeman","html_url":"https://github.com/frozeman","followers_url":"https://api.github.com/users/frozeman/followers","following_url":"https://api.github.com/users/frozeman/following{/other_user}","gists_url":"https://api.github.com/users/frozeman/gists{/gist_id}","starred_url":"https://api.github.com/users/frozeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frozeman/subscriptions","organizations_url":"https://api.github.com/users/frozeman/orgs","repos_url":"https://api.github.com/users/frozeman/repos","events_url":"https://api.github.com/users/frozeman/events{/privacy}","received_events_url":"https://api.github.com/users/frozeman/received_events","type":"User","site_admin":false},"created_at":"2015-11-17T16:38:43Z","updated_at":"2015-11-17T16:38:43Z","body":"After running the registerHttpProtocol now for a while electron crashed with the following log:\r\n```\r\n  method: 'POST',\r\n  referrer: '' }\r\n{ url: 'http://localhost:3050/sockjs/info?cb=iml3pgeom9',\r\n  method: 'GET',\r\n  referrer: '' }\r\nElectron(3296,0x7fff79a42000) malloc: *** mach_vm_map(size=4189037517031501824) failed (error code=3)\r\n*** error: can't allocate region\r\n*** set a breakpoint in malloc_error_break to debug\r\n[3296:1117/173627:FATAL:memory.cc(18)] Out of memory. size=4189037517031498112\r\n```\r\n\r\nAny idea?\r\n\r\nI was losing all the requests. This is all the code used:\r\n\r\n```js\r\n\r\nprotocol.registerHttpProtocol('eth', function(request, callback) {\r\n\r\n    var call = {\r\n        url: 'http://localhost:3050/' + request.url.replace('eth://',''),\r\n        method: request.method,\r\n        referrer: request.referrer\r\n    };\r\n\r\n    console.log(call);\r\n\r\n    callback(call);\r\n\r\n}, function (error) {\r\n  if (error)\r\n    console.error('Failed to register protocol')\r\n});\r\n```"}}