├── .gitignore ├── CODE_OF_CONDUCT.md ├── LICENSE ├── R ├── hello │ └── function.json ├── host.json ├── local.settings-example.json ├── readme.md └── rserver.R ├── README.md ├── Rust ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── README.md ├── SimpleHttpTrigger │ └── function.json ├── host.json ├── local.settings-example.json └── src │ └── main.rs ├── SECURITY.md └── go ├── BlobTrigger └── function.json ├── GoCustomHandlers.go ├── HttpTriggerStringReturnValue └── function.json ├── HttpTriggerWithOutputs └── function.json ├── QueueTrigger └── function.json ├── QueueTriggerWithOutputs └── function.json ├── SimpleHttpTrigger └── function.json ├── SimpleHttpTriggerWithReturn └── function.json ├── host.json ├── local.settings-example.json └── readme.md /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | [Ll]ogs/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | # Uncomment if you have tasks that create the project's static files in wwwroot 37 | #wwwroot/ 38 | 39 | # Visual Studio 2017 auto generated files 40 | Generated\ Files/ 41 | 42 | # MSTest test Results 43 | [Tt]est[Rr]esult*/ 44 | [Bb]uild[Ll]og.* 45 | 46 | # NUnit 47 | *.VisualState.xml 48 | TestResult.xml 49 | nunit-*.xml 50 | 51 | # Build Results of an ATL Project 52 | [Dd]ebugPS/ 53 | [Rr]eleasePS/ 54 | dlldata.c 55 | 56 | # Benchmark Results 57 | BenchmarkDotNet.Artifacts/ 58 | 59 | # .NET Core 60 | project.lock.json 61 | project.fragment.lock.json 62 | artifacts/ 63 | 64 | # StyleCop 65 | StyleCopReport.xml 66 | 67 | # Files built by Visual Studio 68 | *_i.c 69 | *_p.c 70 | *_h.h 71 | *.ilk 72 | *.meta 73 | *.obj 74 | *.iobj 75 | *.pch 76 | *.pdb 77 | *.ipdb 78 | *.pgc 79 | *.pgd 80 | *.rsp 81 | *.sbr 82 | *.tlb 83 | *.tli 84 | *.tlh 85 | *.tmp 86 | *.tmp_proj 87 | *_wpftmp.csproj 88 | *.log 89 | *.vspscc 90 | *.vssscc 91 | .builds 92 | *.pidb 93 | *.svclog 94 | *.scc 95 | 96 | # Chutzpah Test files 97 | _Chutzpah* 98 | 99 | # Visual C++ cache files 100 | ipch/ 101 | *.aps 102 | *.ncb 103 | *.opendb 104 | *.opensdf 105 | *.sdf 106 | *.cachefile 107 | *.VC.db 108 | *.VC.VC.opendb 109 | 110 | # Visual Studio profiler 111 | *.psess 112 | *.vsp 113 | *.vspx 114 | *.sap 115 | 116 | # Visual Studio Trace Files 117 | *.e2e 118 | 119 | # TFS 2012 Local Workspace 120 | $tf/ 121 | 122 | # Guidance Automation Toolkit 123 | *.gpState 124 | 125 | # ReSharper is a .NET coding add-in 126 | _ReSharper*/ 127 | *.[Rr]e[Ss]harper 128 | *.DotSettings.user 129 | 130 | # TeamCity is a build add-in 131 | _TeamCity* 132 | 133 | # DotCover is a Code Coverage Tool 134 | *.dotCover 135 | 136 | # AxoCover is a Code Coverage Tool 137 | .axoCover/* 138 | !.axoCover/settings.json 139 | 140 | # Visual Studio code coverage results 141 | *.coverage 142 | *.coveragexml 143 | 144 | # NCrunch 145 | _NCrunch_* 146 | .*crunch*.local.xml 147 | nCrunchTemp_* 148 | 149 | # MightyMoose 150 | *.mm.* 151 | AutoTest.Net/ 152 | 153 | # Web workbench (sass) 154 | .sass-cache/ 155 | 156 | # Installshield output folder 157 | [Ee]xpress/ 158 | 159 | # DocProject is a documentation generator add-in 160 | DocProject/buildhelp/ 161 | DocProject/Help/*.HxT 162 | DocProject/Help/*.HxC 163 | DocProject/Help/*.hhc 164 | DocProject/Help/*.hhk 165 | DocProject/Help/*.hhp 166 | DocProject/Help/Html2 167 | DocProject/Help/html 168 | 169 | # Click-Once directory 170 | publish/ 171 | 172 | # Publish Web Output 173 | *.[Pp]ublish.xml 174 | *.azurePubxml 175 | # Note: Comment the next line if you want to checkin your web deploy settings, 176 | # but database connection strings (with potential passwords) will be unencrypted 177 | *.pubxml 178 | *.publishproj 179 | 180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 181 | # checkin your Azure Web App publish settings, but sensitive information contained 182 | # in these scripts will be unencrypted 183 | PublishScripts/ 184 | 185 | # NuGet Packages 186 | *.nupkg 187 | # NuGet Symbol Packages 188 | *.snupkg 189 | # The packages folder can be ignored because of Package Restore 190 | **/[Pp]ackages/* 191 | # except build/, which is used as an MSBuild target. 192 | !**/[Pp]ackages/build/ 193 | # Uncomment if necessary however generally it will be regenerated when needed 194 | #!**/[Pp]ackages/repositories.config 195 | # NuGet v3's project.json files produces more ignorable files 196 | *.nuget.props 197 | *.nuget.targets 198 | 199 | # Microsoft Azure Build Output 200 | csx/ 201 | *.build.csdef 202 | 203 | # Microsoft Azure Emulator 204 | ecf/ 205 | rcf/ 206 | 207 | # Windows Store app package directories and files 208 | AppPackages/ 209 | BundleArtifacts/ 210 | Package.StoreAssociation.xml 211 | _pkginfo.txt 212 | *.appx 213 | *.appxbundle 214 | *.appxupload 215 | 216 | # Visual Studio cache files 217 | # files ending in .cache can be ignored 218 | *.[Cc]ache 219 | # but keep track of directories ending in .cache 220 | !?*.[Cc]ache/ 221 | 222 | # Others 223 | ClientBin/ 224 | ~$* 225 | *~ 226 | *.dbmdl 227 | *.dbproj.schemaview 228 | *.jfm 229 | *.pfx 230 | *.publishsettings 231 | orleans.codegen.cs 232 | 233 | # Including strong name files can present a security risk 234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 235 | #*.snk 236 | 237 | # Since there are multiple workflows, uncomment next line to ignore bower_components 238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 239 | #bower_components/ 240 | 241 | # RIA/Silverlight projects 242 | Generated_Code/ 243 | 244 | # Backup & report files from converting an old project file 245 | # to a newer Visual Studio version. Backup files are not needed, 246 | # because we have git ;-) 247 | _UpgradeReport_Files/ 248 | Backup*/ 249 | UpgradeLog*.XML 250 | UpgradeLog*.htm 251 | ServiceFabricBackup/ 252 | *.rptproj.bak 253 | 254 | # SQL Server files 255 | *.mdf 256 | *.ldf 257 | *.ndf 258 | 259 | # Business Intelligence projects 260 | *.rdl.data 261 | *.bim.layout 262 | *.bim_*.settings 263 | *.rptproj.rsuser 264 | *- [Bb]ackup.rdl 265 | *- [Bb]ackup ([0-9]).rdl 266 | *- [Bb]ackup ([0-9][0-9]).rdl 267 | 268 | # Microsoft Fakes 269 | FakesAssemblies/ 270 | 271 | # GhostDoc plugin setting file 272 | *.GhostDoc.xml 273 | 274 | # Node.js Tools for Visual Studio 275 | .ntvs_analysis.dat 276 | node_modules/ 277 | 278 | # Visual Studio 6 build log 279 | *.plg 280 | 281 | # Visual Studio 6 workspace options file 282 | *.opt 283 | 284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 285 | *.vbw 286 | 287 | # Visual Studio LightSwitch build output 288 | **/*.HTMLClient/GeneratedArtifacts 289 | **/*.DesktopClient/GeneratedArtifacts 290 | **/*.DesktopClient/ModelManifest.xml 291 | **/*.Server/GeneratedArtifacts 292 | **/*.Server/ModelManifest.xml 293 | _Pvt_Extensions 294 | 295 | # Paket dependency manager 296 | .paket/paket.exe 297 | paket-files/ 298 | 299 | # FAKE - F# Make 300 | .fake/ 301 | 302 | # CodeRush personal settings 303 | .cr/personal 304 | 305 | # Python Tools for Visual Studio (PTVS) 306 | __pycache__/ 307 | *.pyc 308 | 309 | # Cake - Uncomment if you are using it 310 | # tools/** 311 | # !tools/packages.config 312 | 313 | # Tabs Studio 314 | *.tss 315 | 316 | # Telerik's JustMock configuration file 317 | *.jmconfig 318 | 319 | # BizTalk build output 320 | *.btp.cs 321 | *.btm.cs 322 | *.odx.cs 323 | *.xsd.cs 324 | 325 | # OpenCover UI analysis results 326 | OpenCover/ 327 | 328 | # Azure Stream Analytics local run output 329 | ASALocalRun/ 330 | 331 | # MSBuild Binary and Structured Log 332 | *.binlog 333 | 334 | # NVidia Nsight GPU debugger configuration file 335 | *.nvuser 336 | 337 | # MFractors (Xamarin productivity tool) working folder 338 | .mfractor/ 339 | 340 | # Local History for Visual Studio 341 | .localhistory/ 342 | 343 | # BeatPulse healthcheck temp database 344 | healthchecksdb 345 | 346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 347 | MigrationBackup/ 348 | 349 | # Ionide (cross platform F# VS Code tools) working folder 350 | .ionide/ 351 | /go/*.exe 352 | /Java/com.java/target/* 353 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Microsoft Open Source Code of Conduct 2 | 3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 4 | 5 | Resources: 6 | 7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) 8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) 9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /R/hello/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "direction": "in", 6 | "name": "req", 7 | "methods": [ 8 | "get", 9 | "post" 10 | ] 11 | }, 12 | { 13 | "type": "http", 14 | "direction": "out", 15 | "name": "res" 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /R/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "extensionBundle": { 4 | "id": "Microsoft.Azure.Functions.ExtensionBundle", 5 | "version": "[1.*, 2.0.0)" 6 | }, 7 | "customHandler": { 8 | "description": { 9 | "defaultExecutablePath": "RScript", 10 | "arguments": ["rserver.R"] 11 | }, 12 | "enableForwardingHttpRequest":true 13 | } 14 | } -------------------------------------------------------------------------------- /R/local.settings-example.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "AzureWebJobsStorage": "YOUR_STORAGE_CONNECTION_STRING" 5 | } 6 | } -------------------------------------------------------------------------------- /R/readme.md: -------------------------------------------------------------------------------- 1 | 2 | # Azure Functions custom handler in R 3 | 4 | The samples available in this folder demonstrate how to implement a [custom handler](https://docs.microsoft.com/azure/azure-functions/functions-custom-handlers) in R. 5 | 6 | Example functions featured in this repo include: 7 | 8 | | Name | Trigger | Input | Output | 9 | |------|---------|-------|--------| 10 | | [hello](../../../tree/master/R/hello) | HTTP | n/a | na/ | 11 | 12 | ## Configuration 13 | 14 | The *local.settings-example.json* is provided to show what values the app is expecting to read from environment variables. Make a copy of *local.settings-example.json* and rename it *local.settings.json* and replace any values that begin with "**YOUR_**" with your values. 15 | -------------------------------------------------------------------------------- /R/rserver.R: -------------------------------------------------------------------------------- 1 | library(httpuv) 2 | 3 | PORTEnv <- Sys.getenv("FUNCTIONS_CUSTOMHANDLER_PORT") 4 | PORT = strtoi(PORTEnv , base = 0L) 5 | 6 | http_not_found <- list( 7 | status=404, 8 | body='404 Not Found' 9 | ) 10 | http_method_not_allowed <- list( 11 | status=405, 12 | body='405 Method Not Allowed' 13 | ) 14 | 15 | hello_handler <- list( 16 | GET = function (request) list(body="Hello world") 17 | # POST = function (request) { ... } 18 | ) 19 | 20 | routes <- list( 21 | '/api/hello' = hello_handler, 22 | # Required by App Engine. 23 | '/_ah/health' = list( 24 | GET = function (request) list() 25 | ) 26 | ) 27 | 28 | router <- function (routes, request) { 29 | # Pick the right handler for this path and method. 30 | # Respond with 404s and 405s if the handler isn't found. 31 | if (!request$PATH_INFO %in% names(routes)) { 32 | return(http_not_found) 33 | } 34 | path_handler <- routes[[request$PATH_INFO]] 35 | 36 | if (!request$REQUEST_METHOD %in% names(path_handler)) { 37 | return(http_method_not_allowed) 38 | } 39 | method_handler <- path_handler[[request$REQUEST_METHOD]] 40 | 41 | return(method_handler(request)) 42 | } 43 | 44 | app <- list( 45 | call = function (request) { 46 | response <- router(routes, request) 47 | 48 | # Provide some defaults for the response 49 | # to make handler code simpler. 50 | if (!'status' %in% names(response)) { 51 | response$status <- 200 52 | } 53 | if (!'headers' %in% names(response)) { 54 | response$headers <- list() 55 | } 56 | if (!'Content-Type' %in% names(response$headers)) { 57 | response$headers[['Content-Type']] <- 'text/plain' 58 | } 59 | 60 | return(response) 61 | } 62 | ) 63 | 64 | cat(paste0("Server listening on :", PORT, "...\n")) 65 | runServer("0.0.0.0", PORT, app) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Azure Functions custom handlers (preview) 2 | 3 | Every Functions app is executed by a language-specific handler. While Azure Functions supports many [language handlers](https://docs.microsoft.com/azure/azure-functions/supported-languages) by default, there are cases where you may want additional control over the app execution environment. Custom handlers give you this additional control. 4 | 5 | Custom handlers are lightweight web servers that receive events from the Functions host. Any language that supports HTTP primitives can implement a custom handler. 6 | 7 | Custom handlers are best suited for situations where you want to: 8 | 9 | - Implement a Functions app in a language beyond the officially supported languages 10 | - Implement a Functions app in a language version or runtime not supported by default 11 | - Have granular control over the app execution environment 12 | 13 | With custom handlers, all [triggers and input and output bindings](https://docs.microsoft.com/azure/azure-functions/functions-triggers-bindings) are supported via [extension bundles](https://docs.microsoft.com/azure/azure-functions/functions-bindings-register). 14 | 15 | Read more [about custom handlers in detail](https://docs.microsoft.com/azure/azure-functions/functions-custom-handlers). 16 | 17 | ## Samples 18 | 19 | The following samples demonstrate how to implement a custom handler in the following languages: 20 | 21 | - [C#](https://github.com/Azure-Samples/functions-custom-handlers/tree/master/CSharp) 22 | - [Go](https://github.com/Azure-Samples/functions-custom-handlers/tree/master/go) 23 | - [Java](https://github.com/Azure-Samples/functions-custom-handlers/tree/master/Java) 24 | - [JavaScript](https://github.com/Azure-Samples/functions-custom-handlers/tree/master/node) 25 | - [R](https://github.com/Azure-Samples/functions-custom-handlers/tree/master/R) 26 | - [Rust](https://github.com/Azure-Samples/functions-custom-handlers/tree/master/Rust) 27 | 28 | ## Docker 29 | 30 | Following is an example dockerfile using azure functions node base image 31 | 32 | ``` 33 | # To enable ssh & remote debugging on app service change the base image to the one below 34 | # FROM mcr.microsoft.com/azure-functions/node:2.0-appservice 35 | FROM mcr.microsoft.com/azure-functions/node:2.0 36 | 37 | ENV AzureWebJobsScriptRoot=/home/site/wwwroot \ 38 | AzureFunctionsJobHost__Logging__Console__IsEnabled=true 39 | 40 | COPY . /home/site/wwwroot 41 | 42 | RUN cd /home/site/wwwroot 43 | 44 | ``` 45 | 46 | Copy any of the samples to the directory where you have dockerfile and build an image -------------------------------------------------------------------------------- /Rust/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | **/*.rs.bk 3 | -------------------------------------------------------------------------------- /Rust/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "autocfg" 5 | version = "0.1.7" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | 8 | [[package]] 9 | name = "bitflags" 10 | version = "1.2.1" 11 | source = "registry+https://github.com/rust-lang/crates.io-index" 12 | 13 | [[package]] 14 | name = "bytes" 15 | version = "0.5.4" 16 | source = "registry+https://github.com/rust-lang/crates.io-index" 17 | 18 | [[package]] 19 | name = "cfg-if" 20 | version = "0.1.10" 21 | source = "registry+https://github.com/rust-lang/crates.io-index" 22 | 23 | [[package]] 24 | name = "fnv" 25 | version = "1.0.6" 26 | source = "registry+https://github.com/rust-lang/crates.io-index" 27 | 28 | [[package]] 29 | name = "fuchsia-zircon" 30 | version = "0.3.3" 31 | source = "registry+https://github.com/rust-lang/crates.io-index" 32 | dependencies = [ 33 | "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 34 | "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 35 | ] 36 | 37 | [[package]] 38 | name = "fuchsia-zircon-sys" 39 | version = "0.3.3" 40 | source = "registry+https://github.com/rust-lang/crates.io-index" 41 | 42 | [[package]] 43 | name = "futures-channel" 44 | version = "0.3.4" 45 | source = "registry+https://github.com/rust-lang/crates.io-index" 46 | dependencies = [ 47 | "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 48 | ] 49 | 50 | [[package]] 51 | name = "futures-core" 52 | version = "0.3.4" 53 | source = "registry+https://github.com/rust-lang/crates.io-index" 54 | 55 | [[package]] 56 | name = "futures-sink" 57 | version = "0.3.4" 58 | source = "registry+https://github.com/rust-lang/crates.io-index" 59 | 60 | [[package]] 61 | name = "futures-task" 62 | version = "0.3.4" 63 | source = "registry+https://github.com/rust-lang/crates.io-index" 64 | 65 | [[package]] 66 | name = "futures-util" 67 | version = "0.3.4" 68 | source = "registry+https://github.com/rust-lang/crates.io-index" 69 | dependencies = [ 70 | "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 71 | "futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 72 | "pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)", 73 | ] 74 | 75 | [[package]] 76 | name = "h2" 77 | version = "0.2.2" 78 | source = "registry+https://github.com/rust-lang/crates.io-index" 79 | dependencies = [ 80 | "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", 81 | "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", 82 | "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 83 | "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 84 | "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 85 | "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 86 | "indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", 87 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", 88 | "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 89 | "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", 90 | "tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 91 | ] 92 | 93 | [[package]] 94 | name = "hello-world-server" 95 | version = "0.1.0" 96 | dependencies = [ 97 | "hyper 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)", 98 | "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", 99 | ] 100 | 101 | [[package]] 102 | name = "http" 103 | version = "0.2.0" 104 | source = "registry+https://github.com/rust-lang/crates.io-index" 105 | dependencies = [ 106 | "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", 107 | "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", 108 | "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", 109 | ] 110 | 111 | [[package]] 112 | name = "http-body" 113 | version = "0.3.1" 114 | source = "registry+https://github.com/rust-lang/crates.io-index" 115 | dependencies = [ 116 | "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", 117 | "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 118 | ] 119 | 120 | [[package]] 121 | name = "httparse" 122 | version = "1.3.4" 123 | source = "registry+https://github.com/rust-lang/crates.io-index" 124 | 125 | [[package]] 126 | name = "hyper" 127 | version = "0.13.3" 128 | source = "registry+https://github.com/rust-lang/crates.io-index" 129 | dependencies = [ 130 | "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", 131 | "futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 132 | "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 133 | "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 134 | "h2 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 135 | "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 136 | "http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 137 | "httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 138 | "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", 139 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", 140 | "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", 141 | "pin-project 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", 142 | "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", 143 | "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", 144 | "tower-service 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", 145 | "want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", 146 | ] 147 | 148 | [[package]] 149 | name = "indexmap" 150 | version = "1.3.0" 151 | source = "registry+https://github.com/rust-lang/crates.io-index" 152 | dependencies = [ 153 | "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", 154 | ] 155 | 156 | [[package]] 157 | name = "iovec" 158 | version = "0.1.4" 159 | source = "registry+https://github.com/rust-lang/crates.io-index" 160 | dependencies = [ 161 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", 162 | ] 163 | 164 | [[package]] 165 | name = "itoa" 166 | version = "0.4.4" 167 | source = "registry+https://github.com/rust-lang/crates.io-index" 168 | 169 | [[package]] 170 | name = "kernel32-sys" 171 | version = "0.2.2" 172 | source = "registry+https://github.com/rust-lang/crates.io-index" 173 | dependencies = [ 174 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 175 | "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 176 | ] 177 | 178 | [[package]] 179 | name = "lazy_static" 180 | version = "1.4.0" 181 | source = "registry+https://github.com/rust-lang/crates.io-index" 182 | 183 | [[package]] 184 | name = "libc" 185 | version = "0.2.65" 186 | source = "registry+https://github.com/rust-lang/crates.io-index" 187 | 188 | [[package]] 189 | name = "log" 190 | version = "0.4.8" 191 | source = "registry+https://github.com/rust-lang/crates.io-index" 192 | dependencies = [ 193 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 194 | ] 195 | 196 | [[package]] 197 | name = "memchr" 198 | version = "2.3.3" 199 | source = "registry+https://github.com/rust-lang/crates.io-index" 200 | 201 | [[package]] 202 | name = "mio" 203 | version = "0.6.21" 204 | source = "registry+https://github.com/rust-lang/crates.io-index" 205 | dependencies = [ 206 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 207 | "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 208 | "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 209 | "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 210 | "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 211 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", 212 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", 213 | "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 214 | "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", 215 | "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 216 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 217 | ] 218 | 219 | [[package]] 220 | name = "miow" 221 | version = "0.2.1" 222 | source = "registry+https://github.com/rust-lang/crates.io-index" 223 | dependencies = [ 224 | "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 225 | "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", 226 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 227 | "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 228 | ] 229 | 230 | [[package]] 231 | name = "net2" 232 | version = "0.2.33" 233 | source = "registry+https://github.com/rust-lang/crates.io-index" 234 | dependencies = [ 235 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 236 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", 237 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", 238 | ] 239 | 240 | [[package]] 241 | name = "pin-project" 242 | version = "0.4.8" 243 | source = "registry+https://github.com/rust-lang/crates.io-index" 244 | dependencies = [ 245 | "pin-project-internal 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", 246 | ] 247 | 248 | [[package]] 249 | name = "pin-project-internal" 250 | version = "0.4.8" 251 | source = "registry+https://github.com/rust-lang/crates.io-index" 252 | dependencies = [ 253 | "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", 254 | "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", 255 | "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", 256 | ] 257 | 258 | [[package]] 259 | name = "pin-project-lite" 260 | version = "0.1.4" 261 | source = "registry+https://github.com/rust-lang/crates.io-index" 262 | 263 | [[package]] 264 | name = "pin-utils" 265 | version = "0.1.0-alpha.4" 266 | source = "registry+https://github.com/rust-lang/crates.io-index" 267 | 268 | [[package]] 269 | name = "proc-macro2" 270 | version = "1.0.9" 271 | source = "registry+https://github.com/rust-lang/crates.io-index" 272 | dependencies = [ 273 | "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 274 | ] 275 | 276 | [[package]] 277 | name = "quote" 278 | version = "1.0.3" 279 | source = "registry+https://github.com/rust-lang/crates.io-index" 280 | dependencies = [ 281 | "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", 282 | ] 283 | 284 | [[package]] 285 | name = "redox_syscall" 286 | version = "0.1.56" 287 | source = "registry+https://github.com/rust-lang/crates.io-index" 288 | 289 | [[package]] 290 | name = "slab" 291 | version = "0.4.2" 292 | source = "registry+https://github.com/rust-lang/crates.io-index" 293 | 294 | [[package]] 295 | name = "syn" 296 | version = "1.0.16" 297 | source = "registry+https://github.com/rust-lang/crates.io-index" 298 | dependencies = [ 299 | "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", 300 | "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", 301 | "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 302 | ] 303 | 304 | [[package]] 305 | name = "time" 306 | version = "0.1.42" 307 | source = "registry+https://github.com/rust-lang/crates.io-index" 308 | dependencies = [ 309 | "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", 310 | "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", 311 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", 312 | ] 313 | 314 | [[package]] 315 | name = "tokio" 316 | version = "0.2.13" 317 | source = "registry+https://github.com/rust-lang/crates.io-index" 318 | dependencies = [ 319 | "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", 320 | "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", 321 | "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 322 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 323 | "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 324 | "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", 325 | "pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 326 | "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 327 | "tokio-macros 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", 328 | ] 329 | 330 | [[package]] 331 | name = "tokio-macros" 332 | version = "0.2.5" 333 | source = "registry+https://github.com/rust-lang/crates.io-index" 334 | dependencies = [ 335 | "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", 336 | "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", 337 | "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", 338 | ] 339 | 340 | [[package]] 341 | name = "tokio-util" 342 | version = "0.2.0" 343 | source = "registry+https://github.com/rust-lang/crates.io-index" 344 | dependencies = [ 345 | "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", 346 | "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 347 | "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 348 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", 349 | "pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 350 | "tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", 351 | ] 352 | 353 | [[package]] 354 | name = "tower-service" 355 | version = "0.3.0" 356 | source = "registry+https://github.com/rust-lang/crates.io-index" 357 | 358 | [[package]] 359 | name = "try-lock" 360 | version = "0.2.2" 361 | source = "registry+https://github.com/rust-lang/crates.io-index" 362 | 363 | [[package]] 364 | name = "unicode-xid" 365 | version = "0.2.0" 366 | source = "registry+https://github.com/rust-lang/crates.io-index" 367 | 368 | [[package]] 369 | name = "want" 370 | version = "0.3.0" 371 | source = "registry+https://github.com/rust-lang/crates.io-index" 372 | dependencies = [ 373 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", 374 | "try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 375 | ] 376 | 377 | [[package]] 378 | name = "winapi" 379 | version = "0.2.8" 380 | source = "registry+https://github.com/rust-lang/crates.io-index" 381 | 382 | [[package]] 383 | name = "winapi" 384 | version = "0.3.8" 385 | source = "registry+https://github.com/rust-lang/crates.io-index" 386 | dependencies = [ 387 | "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 388 | "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 389 | ] 390 | 391 | [[package]] 392 | name = "winapi-build" 393 | version = "0.1.1" 394 | source = "registry+https://github.com/rust-lang/crates.io-index" 395 | 396 | [[package]] 397 | name = "winapi-i686-pc-windows-gnu" 398 | version = "0.4.0" 399 | source = "registry+https://github.com/rust-lang/crates.io-index" 400 | 401 | [[package]] 402 | name = "winapi-x86_64-pc-windows-gnu" 403 | version = "0.4.0" 404 | source = "registry+https://github.com/rust-lang/crates.io-index" 405 | 406 | [[package]] 407 | name = "ws2_32-sys" 408 | version = "0.2.1" 409 | source = "registry+https://github.com/rust-lang/crates.io-index" 410 | dependencies = [ 411 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 412 | "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 413 | ] 414 | 415 | [metadata] 416 | "checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" 417 | "checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" 418 | "checksum bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1" 419 | "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 420 | "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" 421 | "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" 422 | "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" 423 | "checksum futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c77d04ce8edd9cb903932b608268b3fffec4163dc053b3b402bf47eac1f1a8" 424 | "checksum futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f25592f769825e89b92358db00d26f965761e094951ac44d3663ef25b7ac464a" 425 | "checksum futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3466821b4bc114d95b087b850a724c6f83115e929bc88f1fa98a3304a944c8a6" 426 | "checksum futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7b0a34e53cf6cdcd0178aa573aed466b646eb3db769570841fda0c7ede375a27" 427 | "checksum futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "22766cf25d64306bedf0384da004d05c9974ab104fcc4528f1236181c18004c5" 428 | "checksum h2 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9d5c295d1c0c68e4e42003d75f908f5e16a1edd1cbe0b0d02e4dc2006a384f47" 429 | "checksum http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b708cc7f06493459026f53b9a61a7a121a5d1ec6238dee58ea4941132b30156b" 430 | "checksum http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" 431 | "checksum httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" 432 | "checksum hyper 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e7b15203263d1faa615f9337d79c1d37959439dc46c2b4faab33286fadc2a1c5" 433 | "checksum indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712d7b3ea5827fcb9d4fda14bf4da5f136f0db2ae9c8f4bd4e2d1c6fde4e6db2" 434 | "checksum iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" 435 | "checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" 436 | "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" 437 | "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 438 | "checksum libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)" = "1a31a0627fdf1f6a39ec0dd577e101440b7db22672c0901fe00a9a6fbb5c24e8" 439 | "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" 440 | "checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" 441 | "checksum mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)" = "302dec22bcf6bae6dfb69c647187f4b4d0fb6f535521f7bc022430ce8e12008f" 442 | "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" 443 | "checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" 444 | "checksum pin-project 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7804a463a8d9572f13453c516a5faea534a2403d7ced2f0c7e100eeff072772c" 445 | "checksum pin-project-internal 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "385322a45f2ecf3410c68d2a549a4a2685e8051d0f278e39743ff4e451cb9b3f" 446 | "checksum pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "237844750cfbb86f67afe27eee600dfbbcb6188d734139b534cbfbf4f96792ae" 447 | "checksum pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5894c618ce612a3fa23881b152b608bafb8c56cfc22f434a3ba3120b40f7b587" 448 | "checksum proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6c09721c6781493a2a492a96b5a5bf19b65917fe6728884e7c44dd0c60ca3435" 449 | "checksum quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f" 450 | "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" 451 | "checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" 452 | "checksum syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)" = "123bd9499cfb380418d509322d7a6d52e5315f064fe4b3ad18a53d6b92c07859" 453 | "checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" 454 | "checksum tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "0fa5e81d6bc4e67fe889d5783bd2a128ab2e0cfa487e0be16b6a8d177b101616" 455 | "checksum tokio-macros 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c3acc6aa564495a0f2e1d59fab677cd7f81a19994cfc7f3ad0e64301560389" 456 | "checksum tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "571da51182ec208780505a32528fc5512a8fe1443ab960b3f2f3ef093cd16930" 457 | "checksum tower-service 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" 458 | "checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" 459 | "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" 460 | "checksum want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" 461 | "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" 462 | "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" 463 | "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" 464 | "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 465 | "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 466 | "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" 467 | -------------------------------------------------------------------------------- /Rust/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "hello-world-server" 3 | version = "0.1.0" 4 | authors = ["paulbatum"] 5 | edition = "2018" 6 | 7 | [dependencies] 8 | hyper = "0.13.3" 9 | tokio = { version = "0.2.13", features = ["macros"] } -------------------------------------------------------------------------------- /Rust/README.md: -------------------------------------------------------------------------------- 1 | # Azure Functions custom handler in Rust 2 | 3 | The samples available in this folder demonstrate how to implement a [custom handler](https://docs.microsoft.com/azure/azure-functions/functions-custom-handlers) in Rust. 4 | 5 | Example functions featured in this repo include: 6 | 7 | | Name | Trigger | Input | Output | 8 | |------|---------|-------|--------| 9 | | [SimpleHttpTrigger](../../../tree/master/Rust/SimpleHttpTrigger) | HTTP | n/a | n/a | 10 | 11 | ## Configuration 12 | 13 | The *local.settings-example.json* is provided to show what values the app is expecting to read from environment variables. Make a copy of *local.settings-example.json* and rename it *local.settings.json* and replace any values that begin with "**YOUR_**" with your values. 14 | 15 | ## Pre-reqs 16 | 17 | - Rust : https://www.rust-lang.org/learn/get-started 18 | - Azure Functions Core Tools 19 | 20 | ## Build + Run 21 | 22 | - run `cargo build` 23 | - run `func host start` 24 | 25 | **NOTE**: if running on a non-Windows platform you will have to remove ".exe" from the `defaultExecutablePath` in the `host.json`. 26 | -------------------------------------------------------------------------------- /Rust/SimpleHttpTrigger/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "type": "httpTrigger", 5 | "direction": "in", 6 | "name": "req", 7 | "methods": [ 8 | "get", 9 | "post" 10 | ] 11 | }, 12 | { 13 | "type": "http", 14 | "direction": "out", 15 | "name": "res" 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /Rust/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "extensionBundle": { 4 | "id": "Microsoft.Azure.Functions.ExtensionBundle", 5 | "version": "[1.*, 2.0.0)" 6 | }, 7 | "customHandler": { 8 | "description": { 9 | "defaultExecutablePath": "target/debug/hello-world-server.exe" 10 | }, 11 | "enableForwardingHttpRequest":true 12 | } 13 | } -------------------------------------------------------------------------------- /Rust/local.settings-example.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "AzureWebJobsStorage": "YOUR_STORAGE_CONNECTION_STRING" 5 | } 6 | } -------------------------------------------------------------------------------- /Rust/src/main.rs: -------------------------------------------------------------------------------- 1 | use hyper::service::{make_service_fn, service_fn}; 2 | use hyper::{Body, Error, Request, Response, Server}; 3 | use hyper::{Method, StatusCode}; 4 | use std::convert::Infallible; 5 | use std::env; 6 | 7 | async fn handler(req: Request
) -> Result