{"action":"created","issue":{"url":"https://api.github.com/repos/wiremod/wire/issues/1040","labels_url":"https://api.github.com/repos/wiremod/wire/issues/1040/labels{/name}","comments_url":"https://api.github.com/repos/wiremod/wire/issues/1040/comments","events_url":"https://api.github.com/repos/wiremod/wire/issues/1040/events","html_url":"https://github.com/wiremod/wire/pull/1040","id":119867256,"number":1040,"title":"Handle HTTP (optionally, but by default) clientside","user":{"login":"SwadicalRag","id":10724598,"avatar_url":"https://avatars.githubusercontent.com/u/10724598?v=3","gravatar_id":"","url":"https://api.github.com/users/SwadicalRag","html_url":"https://github.com/SwadicalRag","followers_url":"https://api.github.com/users/SwadicalRag/followers","following_url":"https://api.github.com/users/SwadicalRag/following{/other_user}","gists_url":"https://api.github.com/users/SwadicalRag/gists{/gist_id}","starred_url":"https://api.github.com/users/SwadicalRag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SwadicalRag/subscriptions","organizations_url":"https://api.github.com/users/SwadicalRag/orgs","repos_url":"https://api.github.com/users/SwadicalRag/repos","events_url":"https://api.github.com/users/SwadicalRag/events{/privacy}","received_events_url":"https://api.github.com/users/SwadicalRag/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":35,"created_at":"2015-12-02T04:50:12Z","updated_at":"2015-12-04T20:38:31Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/wiremod/wire/pulls/1040","html_url":"https://github.com/wiremod/wire/pull/1040","diff_url":"https://github.com/wiremod/wire/pull/1040.diff","patch_url":"https://github.com/wiremod/wire/pull/1040.patch"},"body":"Addresses #1026\r\n\r\nThis is my first pull request to the wire repo, I apologise in advance if I didn't follow any specific procedure as to making a pull request correctly!\r\n\r\nThis PR adds in clientside HTTP handling: something that will hopefully get HTTP enabled by default again. This PR also adds in a convar `wire_expression2_http_client [= 1]`, which will allow server owners to easily enable or disable clientside HTTP request handling. Sending requests from the client to the server comes at a sharp price of latency, and allowing server owners to re-enable serverside requests to reduce latency whilst acknowledging the security concerns is important in my opinion.\r\n\r\nI will try my best to respond to any concerns of code quality. I don't usually contribute to public repositories because I find it difficult to write code in styles I am not comfortable with. Nonetheless, this is not my repo, and as such I will address any concerns that you have.\r\n\r\nI have commented on most of the code in this PR, which will hopefully make the code more maintainable and readable. Please do not hesitate to contact me if you feel that parts of the code are unreadable.\r\n\r\nI have prioritised compatibility: the HTTP library will work as it had always worked in E2 even when clientside requests are enabled or disabled.\r\n\r\n-- swadical"},"comment":{"url":"https://api.github.com/repos/wiremod/wire/issues/comments/162075710","html_url":"https://github.com/wiremod/wire/pull/1040#issuecomment-162075710","issue_url":"https://api.github.com/repos/wiremod/wire/issues/1040","id":162075710,"user":{"login":"TomyLobo","id":963797,"avatar_url":"https://avatars.githubusercontent.com/u/963797?v=3","gravatar_id":"","url":"https://api.github.com/users/TomyLobo","html_url":"https://github.com/TomyLobo","followers_url":"https://api.github.com/users/TomyLobo/followers","following_url":"https://api.github.com/users/TomyLobo/following{/other_user}","gists_url":"https://api.github.com/users/TomyLobo/gists{/gist_id}","starred_url":"https://api.github.com/users/TomyLobo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomyLobo/subscriptions","organizations_url":"https://api.github.com/users/TomyLobo/orgs","repos_url":"https://api.github.com/users/TomyLobo/repos","events_url":"https://api.github.com/users/TomyLobo/events{/privacy}","received_events_url":"https://api.github.com/users/TomyLobo/received_events","type":"User","site_admin":false},"created_at":"2015-12-04T20:38:31Z","updated_at":"2015-12-04T20:38:31Z","body":"@SwadicalRag I think we may have been talking past each other.\r\nThose two pieces of code I posted are on the lua side as an example of how to implement it.\r\nThey are not E2 code and they are not examples of how it should be possible to use it.\r\n\r\nOn the other hand, I do like the idea of having httpCanRequest. However, make that one function whose functionality depends on the current HTTP request mode.\r\n\r\nBtw, having a httpCanRequest function strictly requires that the server knows the client's whitelist.\r\nLet's just decide that that's a good idea in general :)"}}