Giter VIP home page Giter VIP logo

ccurl's Introduction

Kitura

A Swift Web Framework and HTTP Server

Docs Build Status - Master macOS Linux Apache 2 codecov codebeat badge Slack Status

Summary

Kitura is a web framework and web server that is created for web services written in Swift. For more information, visit www.kitura.dev.

Table of Contents

Features

  • URL routing (e.g., GET, POST, PUT, DELETE, PATCH)
  • Codable routing
  • URL parameters
  • Static file serving
  • FastCGI support
  • SSL/TLS support
  • Pluggable middleware

Getting Started

Visit https://www.kitura.dev for a Getting Started guide, tutorials, and API reference documentation.

Contributing to Kitura

All improvements to Kitura are very welcome! Here's how to get started with developing Kitura itself.

  1. Clone this repository.

$ git clone https://github.com/Kitura/Kitura

  1. Build and run tests.

$ swift test

You can find more info on contributing to Kitura in our contributing guidelines.

Notes

  • Swift-NIO is now the default network engine via the Kitura-NIO package. If for some reason you require the old Kitura-net package, you can still enable it by setting an environment variable KITURA_NIO=0 during build.
  • Most Kitura packages have been updated to require at least Swift 5.2 in order to maintain backward compatibility.

Community

We love to talk server-side Swift, and Kitura. Join our Slack to meet the team!

ccurl's People

Contributors

adellibovi avatar akrabat avatar dannys42 avatar dfirsht avatar djones6 avatar dsperling avatar ianpartridge avatar na-gupta avatar quanvo87 avatar rfdickerson avatar shihabmehboob avatar shmuelk avatar toto avatar ymesika avatar youming-lin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ccurl's Issues

CURLOPT_SSL_VERIFYSTATUS not available on Linux

I want to enable OCSP Stapling, according to CURL I should set CURLOPT_SSL_VERIFYSTATUS.
In XCode the project is building. But on linux I'll get the following error:

/root/project/.build-ubuntu/checkouts/Kitura-net/Sources/KituraNet/ClientRequest.swift:652:38: error: use of unresolved identifier 'CURLOPT_SSL_VERIFYSTATUS'
        curlHelperSetOptInt(handle!, CURLOPT_SSL_VERIFYSTATUS, 1)
                                     ^~~~~~~~~~~~~~~~~~~~~~~~
CCurl.CURLOPT_SSL_VERIFYHOST:1:12: note: did you mean 'CURLOPT_SSL_VERIFYHOST'?
public var CURLOPT_SSL_VERIFYHOST: CURLoption { get }
           ^
CCurl.CURLOPT_SSL_VERIFYPEER:1:12: note: did you mean 'CURLOPT_SSL_VERIFYPEER'?
public var CURLOPT_SSL_VERIFYPEER: CURLoption { get }

Here is my Kitura-Net Fork I used to implement this:
https://github.com/geertberkers/Kitura-net/blob/c99aabe49911b24dd3c22d403e25014051694912/Sources/KituraNet/ClientRequest.swift#L652

0.0.2 seems to break previous installation

Seems that 0.0.2 breaks installation with this error:

Target: x86_64-unknown-linux-gnu
/root/swift-DEVELOPMENT-SNAPSHOT-2016-03-24-a-ubuntu15.10/usr/bin/swift -frontend -interpret /data/swift/tori/Packages/CCurl/Package.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -I /root/swift-DEVELOPMENT-SNAPSHOT-2016-03-24-a-ubuntu15.10/usr/lib/swift/pm -module-name Package -lPackageDescription -- -fileno 3
/data/swift/tori/Packages/CCurl/Package.swift:19:22: error: incorrect argument labels in call (have 'name:pkgConfig:providers:', expected 'name:targets:dependencies:')
let package = Package(
                     ^

looking at the error seems pretty related to the new struct of the package file

Using CCurl in a Kitura based app produces linker errors on Linux only

In an attempt to use CCurl to develop an SMTP client in Swift, I ran into this problem where the inline functions in shim.h produce linker errors on Linux. macOS works fine.

Functions such as curlHelperSetOptString and curlHelperSetOptInt work fine inside Kitura, but when they are used in an app, a multiple definition of 'curlHelperSetOptString' error occurs.

The functions are defined as inline in shim.h so I am not sure why the compiler is creating a symbol.

Attached is a HelloWorld Kitura based sample app that demonstrates the problem. Tun run execute:

HelloWorld.zip

docker-compose up

I have tried a few changes such as changing "extern inline" to "inline", or moving the declarations to a 'C' file but these cause different issues.

Error output:

test_1  | Compile Swift Module 'LoggerAPI' (1 sources)
test_1  | Compile Swift Module 'Socket' (3 sources)
test_1  | Compile Swift Module 'SwiftyJSON' (2 sources)
test_1  | Compile Swift Module 'KituraTemplateEngine' (1 sources)
test_1  | Compile CHttpParser utils.c
test_1  | clang: warning: argument unused during compilation: '-Xcc'
test_1  | Compile CHttpParser http_parser.c
test_1  | Compile Swift Module 'KituraSys' (3 sources)
test_1  | clang: warning: argument unused during compilation: '-Xcc'
test_1  | Linking CHttpParser
test_1  | Compile Swift Module 'KituraNet' (12 sources)
test_1  | Compile Swift Module 'Kitura' (35 sources)
test_1  | Compile Swift Module 'HelloWorld' (1 sources)
test_1  | Linking .build/debug/HelloWorld
test_1  | /usr/bin/ld.gold: error: /test/.build/debug/KituraNet.build/ClientRequest.swift.o: multiple definition of 'curlHelperSetOptInt'
test_1  | /usr/bin/ld.gold: /test/.build/debug/HelloWorld.build/main.swift.o: previous definition here
test_1  | /usr/bin/ld.gold: error: /test/.build/debug/KituraNet.build/ClientRequest.swift.o: multiple definition of 'curlHelperSetOptList'
test_1  | /usr/bin/ld.gold: /test/.build/debug/HelloWorld.build/main.swift.o: previous definition here
test_1  | /usr/bin/ld.gold: error: /test/.build/debug/KituraNet.build/ClientRequest.swift.o: multiple definition of 'curlHelperSetOptReadFunc'
test_1  | /usr/bin/ld.gold: /test/.build/debug/HelloWorld.build/main.swift.o: previous definition here
test_1  | /usr/bin/ld.gold: error: /test/.build/debug/KituraNet.build/ClientRequest.swift.o: multiple definition of 'curlHelperSetOptString'
test_1  | /usr/bin/ld.gold: /test/.build/debug/HelloWorld.build/main.swift.o: previous definition here
test_1  | clang: error: linker command failed with exit code 1 (use -v to see invocation)
test_1  | <unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)
test_1  | <unknown>:0: error: build had 1 command failures
test_1  | swift-build: error: exit(1): /root/swift-DEVELOPMENT-SNAPSHOT-2016-06-06-a-ubuntu15.10/usr/bin/swift-build-tool -f /test/.build/debug.yaml
helloworld_test_1 exited with code 1

CCurl cannot be used outside debian systems because of .Apt

Notifying that this library cannot be loaded in linux systems other than Debian due to the use of .Apt. In my case I am trying to use /pixelspark/catena.git in an Archlinux system and it fails because of this. Are there ways of avoiding hardcoding apt-get into this library?

Thank you

Documentation

Are there any plans to document the simple usage of this library?
It would be nice to show some simple example in the readme to give an outlook how to use it.

UTF-8 errors and inconsistency when trying to use POSTFIELDS

When trying to use the Stripe API with Swift and cURL I keep receiving complaints from the server along the lines of "Invalid UTF-8 characters found in POST body." On top of that, the behavior seems to be inconsistent and the request will occasionally be accepted by their server, but none of the post fields are used. I put up a repo to show the code I used and I'm wondering if I'm just using cURL/CCurl wrong or if this is a bug.

(this is a question, if someone could please add the label)

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.