Giter VIP home page Giter VIP logo

Comments (5)

choefele avatar choefele commented on June 12, 2024 1

Thanks – will have a look

from swift-lambda-app.

maximveksler avatar maximveksler commented on June 12, 2024

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.

nikola-mladenovic avatar nikola-mladenovic commented on June 12, 2024

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 cping those libraries, removing libcurl.so.4 won't do the trick - the networking still won't work.

from swift-lambda-app.

ingouackaz avatar ingouackaz commented on June 12, 2024

Hi , I Have the same problem, did anyone find a solution ?

from swift-lambda-app.

nikola-mladenovic avatar nikola-mladenovic commented on June 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.