DDNS with Cloudflare API

When hosting private services at home without a public IP, external access is impossible. There are generally three solutions:

  • Option 1: Call your ISP to assign a public IP
  • Option 2: Use IPv6
  • Option 3: Use NAT traversal

This article does not cover NAT traversal, so Option 3 is excluded.

Options 1 and 2 share a common problem: public IP changes. When your public IP changes, you can no longer access your services using the old IP. This is where dynamic DNS (DDNS) comes in—automatically updating DNS records when your IP changes.

Using Linux IDE with WSLg

Most Java programmers use IntelliJ IDEA on Windows for development and deploy to Linux servers. In most cases, Java’s strong cross-platform nature makes this work fine. However, there are times when platform-specific APIs cause cross-platform headaches—for example, Selenium development requires native browser components that need specific runtime environment configuration, and environment differences can lead to extra debugging effort.

  • Windows 11
  • WSL2
  • Ubuntu 22.04

Follow Microsoft’s official guide to set up the WSLg environment.

Implementing Trojan with Netty (Part 2)

This section covers how to implement a SOCKS proxy server that allows TCP traffic. Most network-capable clients (curl, wget, browsers, etc.) can route requests through a proxy via environment variables or settings. Here’s a simple example:

export https_proxy=socks5://127.0.0.1:1080
curl -v https://www.google.com

Before implementing the Trojan protocol, we first need to implement a SOCKS5 proxy server for use by clients.

Implementing Trojan with Netty (Part 1)

selcarpa/surfer tag(1.13-SNAPSHOT)

  • Kotlin
  • Netty
  • Trojan

The project uses Kotlin, a statically typed JVM-based programming language. It compiles to Java bytecode and is fully compatible with the Java ecosystem, seamlessly interoperating with Java code. Its syntax is very similar to Java but offers additional features such as null safety, extension functions, operator overloading, lambda expressions, and property delegation.

Netty is an asynchronous event-driven network application framework for rapid development of maintainable, high-performance protocol servers and clients. Netty is an NIO client-server framework that enables quick development of network applications such as server and client protocols. Netty provides a new way to develop network applications that is easy to use and highly extensible.