ProxyAction
HttpRequest
class and services to create it
Serializable::inspect
to show more useful information
more_collections :: more_collections
Highly specific, but useful, collections-related classes.curl :: native_curl
Binding of C libCurl which allow us to interact with network.serialization :: serialization_core
Abstract services to serialize Nit objects to different formatscore :: union_find
union–find algorithm using an efficient disjoint-set data structure
# Minimal example using a `ProxyAction`
module nitcorn_reverse_proxy is example
import nitcorn::proxy
# Create the virtualhost for your nitcorn server
var vh = new VirtualHost("localhost:8080")
# Create the interface to represent your proxy target
var proxy_interface = new Interface("localhost", 31337)
# Add your action as usual
vh.routes.add new Route("/", new ProxyAction(proxy_interface))
# Let it be (serve)
var factory = new HttpFactory.and_libevent
factory.config.virtual_hosts.add vh
factory.run
lib/nitcorn/examples/src/nitcorn_reverse_proxy.nit:17,1--34,11