Skip to content

Instantly share code, notes, and snippets.

vagrant@precise64:/kong$ bin/busted -o=TAP -t only -k spec/02-integration/05-proxy/05-ssl_spec.lua
ok 1 - SSL proxy_ssl_name #only properly sets the upstream SNI with preserve_host true
not ok 2 - SSL proxy_ssl_name #only properly sets the upstream SNI with preserve_host false
# spec/02-integration/05-proxy/05-ssl_spec.lua @ 178
# Failure message: spec/02-integration/05-proxy/05-ssl_spec.lua:187: Expected objects to be equal.
# Passed in:
# (string) 'ssl3.com'
# Expected:
# (string) 'localhost'
1..2
vagrant@precise64:/kong$ kong stop
Kong stopped
vagrant@precise64:/kong$ kong migrations reset
> Are you sure? This operation is irreversible. [Y/n] y
Schema successfully reset
vagrant@precise64:/kong$ kong start
migrating core for database kong
core migrated up to: 2015-01-12-175310_skeleton
core migrated up to: 2015-01-12-175310_init_schema
core migrated up to: 2015-11-23-817313_nodes
Frame 1: 113 bytes on wire (904 bits), 113 bytes captured (904 bits) on interface 0
Interface id: 0
Encapsulation type: Ethernet (1)
Arrival Time: May 9, 2017 15:47:35.602487000 UTC
[Time shift for this packet: 0.000000000 seconds]
Epoch Time: 1494344855.602487000 seconds
[Time delta from previous captured frame: 0.000000000 seconds]
[Time delta from previous displayed frame: 0.000000000 seconds]
[Time since reference or first frame: 0.000000000 seconds]
Frame Number: 1
From 2b2617a0e472e31a0d8da618e5a64b731a05859c Mon Sep 17 00:00:00 2001
From: Robert Paprocki <robert@cryptobells.com>
Date: Tue, 2 May 2017 16:22:04 -0700
Subject: [PATCH] feat(cors) match configured origins as a regular expression
Use the ngx.re API to match configured origins as regular expressions
against the client Origin header. In cases where a single origin is
configured for the plugin, set the ACAO header if the configuration
contains only non-PCRE metacharacters; otherwise, treat the single
configured origin as a though multiple origins were configured, by
2017/05/19 21:13:40 [debug] 4517#0: malloc: 00007F91968EFBD0:6144
2017/05/19 21:13:40 [debug] 4517#0: malloc: 00007F919692AFB0:237568
2017/05/19 21:13:40 [debug] 4517#0: malloc: 00007F9196964FC0:98304
2017/05/19 21:13:40 [debug] 4517#0: malloc: 00007F919697CFD0:98304
2017/05/19 21:13:40 [debug] 4517#0: epoll add event: fd:8 op:1 ev:00002001
2017/05/19 21:13:40 [debug] 4517#0: epoll add event: fd:9 op:1 ev:00002001
2017/05/19 21:13:40 [debug] 4517#0: epoll add event: fd:10 op:1 ev:00002001
2017/05/19 21:13:40 [debug] 4517#0: setproctitle: "nginx: worker process"
2017/05/19 21:13:40 [debug] 4517#0: worker cycle
2017/05/19 21:13:40 [debug] 4517#0: epoll timer: -1
Frame 1: 76 bytes on wire (608 bits), 76 bytes captured (608 bits) on interface 0
Interface id: 0
Encapsulation type: Linux cooked-mode capture (25)
Arrival Time: May 19, 2017 21:21:17.867668000 UTC
[Time shift for this packet: 0.000000000 seconds]
Epoch Time: 1495228877.867668000 seconds
[Time delta from previous captured frame: 0.000000000 seconds]
[Time delta from previous displayed frame: 0.000000000 seconds]
[Time since reference or first frame: 0.000000000 seconds]
Frame Number: 1
keepalive related error logs. note the 60 second timeout to close the connection pools
root@vagrant-ubuntu-trusty-64:/usr/local/openresty/nginx# grep 4517 ./logs/error.log | grep keepalive
2017/05/19 21:13:45 [debug] 4517#0: *1 lua tcp socket pool get keepalive peer
2017/05/19 21:13:45 [debug] 4517#0: *1 lua tcp socket keepalive connection pool not found
2017/05/19 21:13:45 [debug] 4517#0: *1 lua tcp socket set keepalive: saving connection 00007F919692B438
2017/05/19 21:13:45 [debug] 4517#0: *1 lua tcp socket keepalive create connection pool for key "127.0.0.1:82"
2017/05/19 21:13:45 [debug] 4517#0: *1 lua tcp socket keepalive timeout: 60000 ms
2017/05/19 21:13:45 [debug] 4517#0: *1 lua tcp socket pool get keepalive peer
2017/05/19 21:13:45 [debug] 4517#0: *1 lua tcp socket get keepalive peer: using connection 00007F919692B438, fd:13
$ luajit ./t.lua > /dev/null
---- TRACE 1 start t.lua:12
0014 MOV 7 1
0015 KSTR 8 5 ; "foo"
0016 GGET 9 6 ; "math"
0017 TGETS 9 9 7 ; "random"
0018 KSHORT 10 1
0019 KSHORT 11 10
0020 CALL 9 0 3
0000 . FUNCC ; math.random
$ luajit ./t.lua > /dev/null
---- TRACE 1 start t.lua:10
0014 GGET 7 5 ; "math"
0015 TGETS 7 7 6 ; "random"
0016 KSHORT 8 1
0017 KSHORT 9 10
0018 CALL 7 2 3
0000 . FUNCC ; math.random
0019 ISGE 0 7
0020 JMP 7 => 0024
vagrant@vagrant-ubuntu-trusty-64:/kong$ bin/busted spec/04-invalidations/ -o=TAP
ok 1 - cluster_events with db: postgres #o new() creates an instance
ok 2 - cluster_events with db: postgres #o new() instanciates only once (singleton)
ok 3 - cluster_events with db: postgres #o new() generates an identical node_id for all instances on a node
ok 4 - cluster_events with db: postgres #o new() instanciates but does not start polling
not ok 5 - cluster_events with db: postgres pub/sub broadcasts on a given channel
# spec/04-invalidations/01-cluster_events_spec.lua @ 80
# Failure message: spec/04-invalidations/01-cluster_events_spec.lua:83: opts.dao is required
ok 6 - cluster_events with db: postgres pub/sub broadcasts data to subscribers
ok 7 - cluster_events with db: postgres pub/sub does not broadcast events on the same node