►
From YouTube: VS Code Tunnelling explained
Description
This video will walk you through the results of our investigation of VS Code Tunnelling: https://gitlab.com/gitlab-org/gitlab/-/issues/370122
A
A
So
I
started
working
on
this
this
week
to
figure
out
how
to
connect
the
server
with
the
with
the
client,
like
the
server
vs
code,
server
that
runs
somewhere
on
the
in
your
container
or
on
a
development
server
with
the
client
that
runs
on
your
localhost
and
my
I
was
trying
to
figure
out
whether
we
can
somehow
get
around
having
the
server
exposing
a
port
and
one
of
the
avenues
that
we
were
looking
into
was
vs
code,
tunneling
and
long
story
short.
It's
not
exactly
what
we
were
looking
for.
A
The
vs
code
tunneling
is
responsible
for
tunneling
local
ports
from
your
development
machine
to
your
desktop,
where
you
have
your
vs
code,
client
and
I'll.
Show
you
what
it
means.
So
we
had
this
proposed
api
that
we
were
looking
into
it.
This
proposed
api
is
used
by
the
all
the
microsoft's
remote
extensions
for
connecting
like
the
remote
ssh
extension
where
you
can
connect
through
ssh
to
a
container.
A
Then
there
is
v
wv
wsl,
I
think,
for
windows,
linux,
subsystem
and
and
few
more,
and
so
they
use
this
resolvers
api,
that
not
other
extensions
can't
use,
and
there
were
some
mentions
of
tunneling
tunnel
options
and
then
here
somewhere
they
defined
that
on
workspace.
A
If
I
just
search
for
works
work
space
here
we
go
open
tunnel,
and
so
we
thought
okay.
This
looks
like
you
can
open
some
secure
tunnel
between
the
server
and
the
client
that
it
might
be
better
than
exposing
a
port
and
that's
not
it.
The
tunnels
are
for
forwarding
ports
from
the
server
to
the
client.
So
I'll
show
you
this
I'll.
Show
you
this
diagram
that
I
draw,
and
this
is
what
I'm
going
to
walk
you
through
today.
This
is
how
the
tunneling
works.
A
You
have
your
vs
code
server
and
you
connect
from
your
local
machine
through
ssh
and
if
you
configure
the
ssh
in
a
way
that
you
expose
or
forward
the
server
port
which
is
in
this
case,
is
going
to
be
8
000,
but
it's
arbitrary
and
you
forward
it
to
your
local
machine.
Now
the
vs
code
client
is
going
to
connect
to
this
forwarded
port
and
since
then,
the
whole
communication
between
these
two
happens
by
the
with
the
web
sockets
that
are
running
on
this
x
forwarded
port.
A
Well,
that's
when
you
can
use
tunneling,
you
can
set
up
a
tunnel
from
your
extension
or
from
your
vs
code
client
and
pretty
much
what
the
this
part
of
the
vs
code
server
starts
like
connects
to
that
board
and
then
starts
sending
all
the
traffic
through
the
web
sockets
back
to
this
end
of
the
tunnel
when
it
pretty
much
exposes
on
the
local
port.
The
this
server
point
so
I'll
share
this
diagram
on
the
issue
and
link
to
the
issue
in
the
youtube
video.
A
So
you
can
have
a
look,
but
I'm
gonna
now
go
back
and
forth
between
the
vs
code
and
my
shell
and
I'll
show
you
how
this
works.
So,
let's
start
by
connecting
to
the
let's
start
by
connecting
to
the
remote
server
that
I
started
up,
but
we
need
to
forward
the
port
which
this
says
that
the
server
port
8000
is
going
to
be
forwarded
here
on
on
my
development
machine
on
7070.
So
I'll
do
that
and
then
here
I'll
go
to
my
right
and
I'll
start
start
the
vs
coding
server.
A
We
are
not
using
a
vs
code
because
the
proposed
api
is
closed
and
for
vs
code
you
can't
really
create
your
own
remote
development
extension.
So
this
is
all
on
vs
coding,
which
is
a
which
is
open.
Distribution
of
the
vs
code
license
so
I'll
share
a
link
on
the
issue
as
well.
So
I'll
start
this
vs
codium
server
that
on
port
8000.
That's
the
power
that
I'm
forwarding
and
connection
token
is
gonna,
be
password.
I'm
gonna,
like
you,
don't
have
to
try
to
connect
here.
A
It's
not
gonna
be
open
anymore,
but
just
for
the
demo,
it's
password.
So
I'll
open
the
server
and
all
right-
I've
already
done
that
here,
so
I'm
just
gonna
close
it
and
I'm
gonna
try
again
all
right.
The
survey
started
now,
I'm
using
this
vs
code,
remote
oss
extension,
it's
a
it
was
a
great
help
for
understanding
how
this
whole
thing
works
and
I'll
link
to
the
extension
as
well.
It's
open
source-
and
I
just
had
to
tweak
it
tiny
bit.
A
I
created
this
setting
when
I
set
that
on
my
locals,
because
I'm
forwarding
the
server
through
ssh
so
on
my
localhost
on
porous
port
7070
with
this
password,
I'm
just
running
a
remote
vs
code
server.
That
was
one
change
that
I've
done
and
then
I
created
extra
command
here
for
creating
a
tunnel
because
the
extension
by
default
couldn't
create
a
tunnel,
and
so
I
created
this
hard-coded
that
the
server
upboard
three
thousand
it's
going
to
be
forwarded
to
my
localhost
in
3001
and
you'll,
see
that's
why
that's
important
in
a
second!
A
So
now
I
run
the
extension
that
that
just
opens
the
normal
vsco
window.
I
need
to
connect
to
the
server
so
connect
to
a
host
local.
Now
it's
connected.
You
can
always
check
it
by
seeing
that
it's
home
ubuntu,
even
though
this
is
mac,
I'm
already
accessing
the
server.
So
I
can
open
this
dmp
folder,
for
example,
I'll
open
it
and
then
I'll.
Try
on
the
ubuntu
run
here
the
command
which
is
python3.
I
can't
remember
it
exactly.
It
should
be,
hopefully
somewhere
here
and
it
isn't
so.
A
I'm
just
gonna
have
to
copy
it
from
that
picture
here,
all
right,
so
python
three
and
I
need
to
expose
it
on
port
3000.
That's
what
I
was
showing
here
on
the
picture.
That's
it's
arbitrary!
Just
for
this
demo.
It's
3
000.,
so
I'll
start
a
server,
and
now
I
haven't
created
tunnels.
So
if
I
go
to
port
3001,
it's
it's
unable
to
connect,
but
then
I
can
here
say:
create
a
tunnel.
A
That's
running
this
code.
I
even
have
a
breakpoint
here
around
that
that
creates
the
tunnel.
There
is
no
ui
for
it
by
default,
but
the
tunnel
is
created,
and
now
I
can
just
refresh
here-
and
I
see
hello-
that's
what's
running
on
the
server
and
I
can
change
here,
hello
to
hello.
Vs
code
save
it,
and
if
I
refresh
here,
it's
hello,
vs
code,
so
it's
forwarding
through
the
web
socket
connection.
It's
forwarding
the
port
from
the
server
to
the
client,
exactly
as
this
diagram
is
showing.