Code Monkey home page Code Monkey logo

skyproxy's Introduction

SkyProxy

한 서버에서 여러 도메인을 사용하고자 할때 필요한 프록시 서버입니다.

설치

  1. UPPERCASE가 설치되어 있어야 합니다.
  2. SkyProxy 폴더 자체를 서버에 복사합니다.
  3. RunSkyProxy.js을 원하는 대로 수정합니다.
  4. forever 등으로 실행합니다.
forever start RunSkyProxy.js

RunSkyProxy.js 수정하기

RunSkyProxy.js의 기본 형태는 다음과 같습니다.

require('./SkyProxy.js');

// 멀티코어 사용
CPU_CLUSTERING(function() {
	'use strict';
	
	SkyProxy(function(route, redirect, redirectByLanguage, ready, sroute) {
		...
	});
});

제공되는 함수는 다음과 같습니다.

route

route('a.site.com', 8888);
route('b.site.com', 8889);

redirect

redirect('c.site.com', 'http://b.site.com');

redirectByLanguage

redirectByLanguage('site.com', {
	en : 'http://en.site.com',
	ko : 'http://ko.site.com'
});

ready

ready('ready.site.com');

sroute

https 프로토콜을 사용하는 경우에 사용합니다.

sroute('secure.site.com', 8887, '/home/site/privkey.pem', '/home/site/cert.pem');
// http://secure.site.com to https://secure.site.com
redirect('secure.site.com', 'https://secure.site.com');

404.html

접속한 주소의 리소스를 찾을 수 없는 경우 제공되는 페이지입니다. 수정해서 사용하시기 바랍니다.

ready.html

ready함수로 지정한 도메인에 접속 시 제공되는 준비중 페이지입니다. 수정해서 사용하시기 바랍니다.

라이센스

MIT

작성자

Young Jae Sim

skyproxy's People

Contributors

hanul avatar

Watchers

 avatar

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.