Skip to main content

WSGI Server on TCP

Project description

About

WSGIT is a server which runs WSGI applications on TCP not HTTP so that helps you make server of non-http-clients(such as mobile application) with wsgi applications(like django or flask). It makes mock WSGI Request from TCP to run WSGI application. It receives json response from WSGI application and sends it as bson after adds some HTTP header information in dict.

Examples

Django Example:

def index(request):
    return HttpResponse(json.dumps(dict(page='index')), mimetype='application/json')

urlpatterns = patterns('',
    url(r'^$', index),
)

Run Example:

$ wsgit 0:9338 djangoproject.wsgi.application

Request Example:

>>> from socket import *
>>> import bson
>>> bson.patch_socket()
>>> s = socket(AF_INET, SOCK_STREAM)
>>> s.connect(('127.0.0.1', 9338))
>>> s.sendobj({'url':'/'})
>>> print s.recvobj()
>>> {u'status': {u'reason': 'OK', u'code': '200'}, u'page': u'index'}
>>> s.close()

Changelog

  • 2014.09.14: 0.1.3:

    • Supports HTTP Request headers

  • 2013.10.05: 0.1.2:

    • Command wsgit supports ssl options --keyfile and --certfile

  • 2013.10.03: 0.1.1:

    • Supports SSL

  • 2013.09.22: 0.1:

    • create mock environ to call wsgi application

    • run server with command wsgit

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

WSGIT-0.1.3.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

WSGIT-0.1.3.macosx-10.9-intel.exe (72.3 kB view details)

Uploaded Source

File details

Details for the file WSGIT-0.1.3.tar.gz.

File metadata

  • Download URL: WSGIT-0.1.3.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for WSGIT-0.1.3.tar.gz
Algorithm Hash digest
SHA256 27e4e0b23dbd34eb81d2db74310f051aa09d0bc7eeec0c11f9e8fa360e41da04
MD5 dcf8497da2f0d42dc60a3efaf556fadf
BLAKE2b-256 0be2daaca75df6ef22ecea689c50b0e2742baa3550ba2a4538f42a1299ce8d47

See more details on using hashes here.

File details

Details for the file WSGIT-0.1.3.macosx-10.9-intel.exe.

File metadata

File hashes

Hashes for WSGIT-0.1.3.macosx-10.9-intel.exe
Algorithm Hash digest
SHA256 84570ecf01cc7f8cdc18e8f2fd4fd15b3353c9a8b07b63c728fff121fd5fffbe
MD5 c52e3555bfd8f5d00b292be48d54bfc4
BLAKE2b-256 be729974fbfc4d022457c1242e4d347dbe186f99b121bc8e500c565c5f048536

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page