soto-project / soto

Swift SDK for AWS that works on Linux, macOS and iOS
https://soto.codes
Apache License 2.0
878 stars 83 forks source link

When I am trying to upload video using VPN #655

Closed miteshpopenxcell closed 1 year ago

miteshpopenxcell commented 1 year ago

Getting error : - "POSIXErrorCode(rawValue: 54): Connection reset by peer"

Can you please help me?

adam-fowler commented 1 year ago

Do any operations work across a VPN eg GetObject?

Can you post some code that shows the problem, what version of Soto, Swift are you using and what platform are you running on?

miteshpopenxcell commented 1 year ago

Hello,

I am using VPN(US) Location and a request is a multipart upload. The Soto version is 6.0.0, and the swift version(4.2), the platform is iPhone.

SOTO.pdf

adam-fowler commented 1 year ago

Soto v6.0 doesn't support swift 4.2 are you sure you got that correct? Did you mean 5.2? How have you set up the phone to use the VPN?

miteshpopenxcell commented 1 year ago

Sorry, Yes 5.2,

I am using mobile data and Third-party VPN App(https://apps.apple.com/us/app/id1641457212). Having problems uploading videos.

adam-fowler commented 1 year ago

Ah I think I know what your issue is. Soto does not use URLSession so does not respect iPhone proxy settings. You can possibly get around this by setting up the proxy configuration in HTTPClient used by AWSClient.

import AsyncHTTPClient

let httpClient = HTTPClient(
    eventLoopGroupProvider: .createNew, 
    configuration: .init(proxy: .server(host: *, port: *, authorization: *)
)
let awsClient = AWSClient(..., httpClientProvider: .shard(httpClient)