Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
helje5 committed Oct 4, 2021
2 parents 79662fa + d34ea9c commit 850c62a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
- swift:5.2.5-xenial
- swift:5.3.2-xenial
- swift:5.3.2-bionic
- swift:5.5.0-focal
container: ${{ matrix.image }}
steps:
- name: Checkout Repository
Expand All @@ -30,7 +31,7 @@ jobs:
- name: Select latest available Xcode
uses: maxim-lobanov/[email protected]
with:
xcode-version: 12.2
xcode-version: 13
- name: Checkout Repository
uses: actions/checkout@v2
- name: Build Swift Debug Package
Expand Down
8 changes: 4 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import PackageDescription

let package = Package(

name: "MacroExamples",

platforms: [
Expand All @@ -25,11 +25,11 @@ let package = Package(
// A lot of packages for demonstration purposes, only add what you
// actually need in your own project.
.package(url: "https://github.com/Macro-swift/Macro.git",
from: "0.8.10"),
from: "0.8.11"),
.package(url: "https://github.com/Macro-swift/MacroExpress.git",
from: "0.8.6"),
from: "0.8.8"),
.package(url: "https://github.com/Macro-swift/MacroLambda.git",
from: "0.4.0"),
from: "0.4.1"),
.package(url: "https://github.com/AlwaysRightInstitute/cows",
from: "1.0.7")
],
Expand Down
8 changes: 7 additions & 1 deletion Sources/httpproxy/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ http.createServer { req, res in
// log request
req.log.log("\(req.method) \(req.url)")

guard req.method != "CONNECT" else {
req.log.error("Connect not supported.")
res.writeHead(501)
res.end()
return
}
guard let url = URL(string: req.url),
let scheme = url.scheme, let host = url.host else
{
Expand Down Expand Up @@ -42,7 +48,7 @@ http.createServer { req, res in
}

// Send the request body to the target server
_ = req.pipe(proxiedRequest)
req.pipe(proxiedRequest)
}
.listen(1337) { server in
server.log.log("Server listening on http://0.0.0.0:1337/")
Expand Down

0 comments on commit 850c62a

Please sign in to comment.