-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
103 lines (95 loc) · 3.39 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<!DOCTYPE html>
<html>
<head>
<title>Vulcan - Proxy for web services</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/7.4/styles/tomorrow-night.min.css">
<style type="text/css" media="screen">
.logo {
display: block;
width: 166px;
height: 63px;
background: url(images/vulcan.jpg)
}
body {
background-color:#fafafa;
font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif;
}
code {
font-size: 18px;
}
.container {
padding: 10px 80px;
}
.links {
font-size: 20px;
}
</style>
</head>
<body>
<a href="https://github.com/mailgun/vulcan/tree/sasha/js"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>
<section class="container">
<header>
<a href="/" class="logo" alt="Vulcan"></a>
</header>
<section>
<h2>Proxy for web services</h2>
<p>Vulcan is a proxy built for APi's specific needs, it's a proxy that you program in JavaScript.</p>
<pre><code>function handle(request){
return {upstreams: ["http://localhost:5000", "http://localhost:5001"]}
}
</code></pre>
</section>
<section>
<h2>How slow can your proxy be?</h2>
<p>With services, proxy is rarely a bottleneck, whereas DB and filesystem are. Vulcan supports rate limiting using memory, Cassandra or Redis backends.</p>
<pre><code>function handle(request){
return {
failover: true,
upstreams: ["http://localhost:5000", "http://localhost:5001"],
rates: {request.ip: ["10 requests/second", "1000 KB/second"]}
}
}
</code></pre>
</section>
<section>
<h2>Discovery</h2>
<p>Keeping upstreams in a discovery service simplifies deployment and configuration management. Vulcan supports Etcd or Zookeeper.</p>
<pre><code>function handle(request){
return {
upstreams: discover("/upstreams"),
rates: {request.ip: ["10 requests/second", "1000 KB/second"]}
}
}</code></pre>
</section>
<section>
<h2>Caching and Auth</h2>
<p>Implement custom auth and cache results using memory, Redis or Cassandra.</p>
<pre><code>function handle(request){
response = get(discover("/auth-endpoints"), {auth: request.auth}, {cache: true})
if(!response.code == 200) {
return response
}
return {
upstreams: discover("/upstreams"),
rates: {request.ip: ["10 requests/second", "1000 KB/second"]}
}
}
</code></pre>
</section>
<section>
<h2>Further reading</h2>
<ul class="links">
<li>
Github: <a href="https://github.com/mailgun/vulcan/tree/sasha/js">https://github.com/mailgun/vulcan</a>
</li>
<li>
<a href="https://groups.google.com/forum/#!forum/vulcan-proxy">Mailing list and forum</a>
</li>
</ul>
</section>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/7.4/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</body>
</html>