All Projects → vagusX → Koa Proxies

vagusX / Koa Proxies

Licence: mit
a [email protected] proxy middleware

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Koa Proxies

Trafficlight
🚦 Flexible NodeJS Routing Decorators for API Routing
Stars: ✭ 69 (-44.8%)
Mutual labels:  koa, koa2
Koa Ts
koa2+typescript
Stars: ✭ 82 (-34.4%)
Mutual labels:  koa, koa2
Nodejs Koa Blog
基于 Node.js Koa2 实战开发的一套完整的博客项目网站
Stars: ✭ 1,162 (+829.6%)
Mutual labels:  koa, koa2
Koahub Demo
koahub+async/await+mysql
Stars: ✭ 15 (-88%)
Mutual labels:  koa, koa2
Chatroom
vue2聊天室,图灵机器人,node爬虫
Stars: ✭ 103 (-17.6%)
Mutual labels:  koa, koa2
Vue Socket.io Chat
💬 TypeScript + Vue + Express/Koa + Socket.io
Stars: ✭ 61 (-51.2%)
Mutual labels:  koa, koa2
Koach Javascript
Production ready Koa2 boilerplate.
Stars: ✭ 79 (-36.8%)
Mutual labels:  koa, koa2
Koa Dec Router
An ES6 decorator + class based router, support inherit, override, priority, auto load controllers, etc.
Stars: ✭ 19 (-84.8%)
Mutual labels:  koa, koa2
Koa Mobx React Starter
A straightforward starter for Node javascript web projects. Using Koa, MobX and ReactJS (with universal / isomorphic server rendering)
Stars: ✭ 102 (-18.4%)
Mutual labels:  koa, koa2
Koa Sslify
Enforce HTTPS in node.js koa apps
Stars: ✭ 100 (-20%)
Mutual labels:  koa, koa2
Mysrv
Yet another Node.js web framework, based on koa.js 又一个 Node.js MVC 框架,基于Koa2
Stars: ✭ 10 (-92%)
Mutual labels:  koa, koa2
Postgraphile
GraphQL is a new way of communicating with your server. It eliminates the problems of over- and under-fetching, incorporates strong data types, has built-in introspection, documentation and deprecation capabilities, and is implemented in many programming languages. This all leads to gloriously low-latency user experiences, better developer experiences, and much increased productivity. Because of all this, GraphQL is typically used as a replacement for (or companion to) RESTful API services.
Stars: ✭ 10,967 (+8673.6%)
Mutual labels:  koa, koa2
Koa Generator
Koa' application generator for 1.x and 2.x( Express-style and support all middlewares include async/await )
Stars: ✭ 929 (+643.2%)
Mutual labels:  koa, koa2
Koatty
Koa2 + Typescript = Koatty. Use Typescript's decorator implement IOC and AOP.
Stars: ✭ 67 (-46.4%)
Mutual labels:  koa, koa2
Cykspace Node
博客后台服务~~ 👉👉 http://www.cykspace.com
Stars: ✭ 23 (-81.6%)
Mutual labels:  koa, koa2
Foxman
🍥 an extensible mock server
Stars: ✭ 76 (-39.2%)
Mutual labels:  koa, proxy
Vue Chat
👥Vue全家桶+Socket.io+Express/Koa2打造一个智能聊天室。
Stars: ✭ 887 (+609.6%)
Mutual labels:  koa, koa2
Nodeclub Koa
use koa to rewrite nodeclub
Stars: ✭ 18 (-85.6%)
Mutual labels:  koa, koa2
Gracejs
A Nodejs BFF framework, build with koa2(基于koa2的标准前后端分离框架)
Stars: ✭ 1,302 (+941.6%)
Mutual labels:  koa, proxy
Strapi
🚀 Open source Node.js Headless CMS to easily build customisable APIs
Stars: ✭ 41,786 (+33328.8%)
Mutual labels:  koa, koa2

Koa Proxies

NPM TavisCI Build CircieCI Build Coverage NPM Downloads Greenkeeper badge

[email protected]/next middlware for http proxy

Powered by http-proxy.

Installation

$ npm install koa-proxies --save

Options

http-proxy events

options.events = {
  error (err, req, res) { },
  proxyReq (proxyReq, req, res) { },
  proxyRes (proxyRes, req, res) { }
}

log option

// enable log
options.logs = true; // or false

// custom log function
options.logs = (ctx, target) {
  console.log('%s - %s %s proxy to -> %s', new Date().toISOString(), ctx.req.method, ctx.req.oldPath, new URL(ctx.req.url, target))
} 

Usage

// dependencies
const Koa = require('koa')
const proxy = require('koa-proxies')
const httpsProxyAgent = require('https-proxy-agent')

const app = new Koa()

// middleware
app.use(proxy('/octocat', {
  target: 'https://api.github.com/users',    
  changeOrigin: true,
  agent: new httpsProxyAgent('http://1.2.3.4:88'), // if you need or just delete this line
  rewrite: path => path.replace(/^\/octocat(\/|\/\w+)?$/, '/vagusx'),
  logs: true
}))

JavaScript Style Guide

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].