Comments (5)
Thanks – will have a look
from swift-lambda-app.
Possibly AWS Lambda image has changed but talking 6 months back, I was doing network calls used the carried over libcurl and didn't face any issues with DNS resolving.
Is the issue reproducible on other DNS addresses? Can you supply a sample code please?
from swift-lambda-app.
This is the code from main.swift
:
import Foundation
import Dispatch
let request = URLRequest(url: URL(string: "https://raw.githubusercontent.com/nikola-mladenovic/AwsSwiftSign/master/README.md")!)
let session = URLSession(configuration: .default)
let semaphore = DispatchSemaphore(value: 0)
session.dataTask(with: request, completionHandler: { data, response, error in
if let statusCode = (response as? HTTPURLResponse)?.statusCode {
print("status code: \(statusCode)")
}
if let error = error {
print("error code: \(error._code)")
print("error domain: \(error._domain)")
print("error desc: \(error.localizedDescription)")
}
if let data = data {
print(String(data: data, encoding: .utf8)!)
}
semaphore.signal()
}).resume()
_ = semaphore.wait(timeout: DispatchTime.distantFuture)
I tried to avoid AWS URLs for this example.
Using ibmcom/swift-ubuntu:3.1.1
docker image for compilation and libraries cp
.
To make this a bit easier to test, here're the two zip files, one with libcurl.so.4
included, and the second one without.
libcurl.so.4
included:
lambda_w_libcurl.zip
libcurl.so.4
not included:
lambda_w_o_libcurl.zip
Another useful information is that removing libcurl.so.4
works if you compiled using ubuntu 14.04. However if you try compiling using Swift for ubuntu 16.04 and cp
ing those libraries, removing libcurl.so.4
won't do the trick - the networking still won't work.
from swift-lambda-app.
Hi , I Have the same problem, did anyone find a solution ?
from swift-lambda-app.
You now also have to exclude libresolv.so.2
(along with libcurl.so.4
) in order for networking to work.
from swift-lambda-app.
Related Issues (3)
- Cannot find ARN HOT 1
- AWS Lambada Runtime API HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swift-lambda-app.