<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
        <title>Tutorial - แท็ก - Kawin&#39;s Pages</title>
        <link>https://kawin.dev/tags/tutorial/</link>
        <description>Tutorial - แท็ก - Kawin&#39;s Pages</description>
        <generator>Hugo -- gohugo.io</generator><language>th</language><managingEditor>kawin.v@kkumail.com (Kawin Viriyaprasopsook)</managingEditor>
            <webMaster>kawin.v@kkumail.com (Kawin Viriyaprasopsook)</webMaster><lastBuildDate>Mon, 13 Jul 2026 09:00:00 &#43;0700</lastBuildDate><atom:link href="https://kawin.dev/tags/tutorial/" rel="self" type="application/rss+xml" /><item>
    <title>สร้าง wsProxy ตอนที่ 1 — CLI, Config และ Server</title>
    <link>https://kawin.dev/posts/rust/rust-wsproxy-server/</link>
    <pubDate>Mon, 13 Jul 2026 09:00:00 &#43;0700</pubDate>
    <author>kawin.v@kkumail.com (Kawin Viriyaprasopsook)</author>
    <guid>https://kawin.dev/posts/rust/rust-wsproxy-server/</guid>
    <description><![CDATA[<div class="featured-image">
                <img src="/featured-image.jpeg" referrerpolicy="no-referrer">
            </div><h1 id="สราง-wsproxy-ตอนท-1--cli-config-และ-server">สร้าง wsProxy ตอนที่ 1 — CLI, Config และ Server</h1>
<p>สวัสดีครับ! ในบทความนี้เราจะเริ่มสร้างโปรเจกต์จริง ๆ ชื่อว่า <strong>rs-wsProxy</strong> ซึ่งเป็น WebSocket-to-TCP Proxy ที่ออกแบบมาสำหรับใช้งานร่วมกับ <a href="https://github.com/vthibault/roBrowser" target="_blank" rel="noopener noreffer ">roBrowser</a> (โปรเจกต์จำลอง Ragnarok Online บนเว็บ) เพื่อให้สามารถเชื่อมต่อจากเว็บเบราว์เซอร์ไปยังเซิร์ฟเวอร์เกมได้โดยตรงผ่าน WebSocket</p>
<p>ย้อนกลับไปตอนที่เห็นโพสต์จาก <a href="https://rayrag.com/" target="_blank" rel="noopener noreffer ">rayrag.com</a> บน Facebook ที่เล่น RO บนเว็บเบราว์เซอร์ได้ ผมก็เลยอยากสร้าง proxy ตัวนี้ขึ้นมาเองด้วย Rust หลังจากเรียนรู้พื้นฐานมาทั้ง 6 ตอน ถึงเวลาเอาทุกอย่างมาประกอบกันแล้ว</p>
<p>บทความนี้เป็น Part 1 ของซีรีส์สองส่วน โดยเราจะเน้นไปที่การตั้งค่าโครงสร้างโปรเจกต์ การตั้งค่า CLI ด้วย <code>clap</code> การจัดการการตั้งค่า (configuration) ระบบ logging ด้วย <code>tracing</code> และการตั้งค่าเซิร์ฟเวอร์ HTTP/WebSocket ด้วย <code>axum</code> และ <code>tokio</code></p>
<p>ใน Part 2 (ซึ่งจะตามมาในบทความถัดไป) เราจะเจาะลึกเข้าไปในส่วนของ proxy core — กลไกการเชื่อมต่อ TCP และการส่งต่อข้อมูลระหว่าง WebSocket และ TCP socket รวมถึงการจัดการการเชื่อมต่อแบบพร้อมกันหลาย ๆ รายการ (concurrent connections) และการจัดการข้อผิดพลาด</p>
<p>คุณสามารถดูโค้ดต้นฉบับทั้งหมดได้ที่: <a href="https://github.com/bouroo/rs-wsProxy" target="_blank" rel="noopener noreffer ">https://github.com/bouroo/rs-wsProxy</a></p>]]></description>
</item>
<item>
    <title>Async Rust กับ Tokio</title>
    <link>https://kawin.dev/posts/rust/rust-async-tokio/</link>
    <pubDate>Sun, 12 Jul 2026 09:00:00 &#43;0700</pubDate>
    <author>kawin.v@kkumail.com (Kawin Viriyaprasopsook)</author>
    <guid>https://kawin.dev/posts/rust/rust-async-tokio/</guid>
    <description><![CDATA[<div class="featured-image">
                <img src="/featured-image.jpeg" referrerpolicy="no-referrer">
            </div> async/await, Tokio runtime, spawning tasks, channels และ async I/O สำหรับเขียน network applications]]></description>
</item>
<item>
    <title>Traits และ Generics</title>
    <link>https://kawin.dev/posts/rust/rust-traits-generics/</link>
    <pubDate>Sat, 11 Jul 2026 09:00:00 &#43;0700</pubDate>
    <author>kawin.v@kkumail.com (Kawin Viriyaprasopsook)</author>
    <guid>https://kawin.dev/posts/rust/rust-traits-generics/</guid>
    <description><![CDATA[<div class="featured-image">
                <img src="/featured-image.jpeg" referrerpolicy="no-referrer">
            </div><p>Traits และ Generics คือสองแนวคิดสำคัญที่ทำให้ Rust มีพลังในการเขียนโค้ดที่เป็น generic และสามารถแชร์พฤติกรรมระหว่างประเภทต่าง ๆ ได้อย่างปลอดภัยและมีประสิทธิภาพ บทความนี้เป็นภาคต่อจากภาค 4 ที่เราได้พูดถึง Collections, Iterators และ Error Handling มาแล้ว เราจะเจาะลึกว่า trait ทำหน้าที่เหมือน interface ในภาษาอื่น ๆ เช่น Go หรือ Java อย่างไร และ generics ช่วยให้เราเขียนฟังก์ชันและโครงสร้างข้อมูลที่ทำงานกับหลายประเภทได้โดยไม่สูญเสียประสิทธิภาพ เราจะพูดถึง trait bounds, trait objects รวมถึง trait ที่สำคัญในไลบรารีมาตรฐาน เช่น Display, Debug, Clone, Copy, From, Into และ Default แล้วเชื่อมโยงกับการใช้งานจริงในโปรเจกต์ rs-wsProxy ที่ใช้ Axum, clap และ async/await ด้วย</p>]]></description>
</item>
<item>
    <title>Collections, Iterators และ Error Handling</title>
    <link>https://kawin.dev/posts/rust/rust-collections-errors/</link>
    <pubDate>Fri, 10 Jul 2026 09:00:00 &#43;0700</pubDate>
    <author>kawin.v@kkumail.com (Kawin Viriyaprasopsook)</author>
    <guid>https://kawin.dev/posts/rust/rust-collections-errors/</guid>
    <description><![CDATA[<div class="featured-image">
                <img src="/featured-image.jpeg" referrerpolicy="no-referrer">
            </div><p>การเขียนโปรแกรมใน Rust ไม่ได้หยุดอยู่แค่การเขียนฟังก์ชันและโครงสร้างข้อมูลพื้นฐานเท่านั้น แต่ยังต้องเข้าใจกลไกการจัดการข้อมูลที่ซับซ้อนขึ้น เช่น คอลเลกชันต่างๆ ที่ช่วยให้เราจัดการข้อมูลหลายๆ ชิ้นได้อย่างมีประสิทธิภาพ รวมถึงการใช้อิเทอร์เรเตอร์เพื่อประมวลผลข้อมูลเหล่านั้นอย่างมีประสิทธิภาพ และที่สำคัญที่สุดคือการจัดการข้อผิดพลาดอย่างเหมาะสมด้วยระบบ Result และตัวดำเนินการ ? ซึ่งเป็นหัวใจสำคัญของการเขียนโค้ดที่ปลอดภัยและน่าเชื่อถือใน Rust บทความนี้เป็นส่วนที่ 4 ของซีรีส์ Rust โดยต่อเนื่องจาก Part 3 ที่พูดถึง Structs, Enums และ Pattern Matching และจะนำไปสู่ Part 5 ที่จะพูดถึง Traits และ Generics ต่อไป เราจะเจาะลึกแต่ละหัวข้อด้วยคำอธิบายอย่างละเอียดและตัวอย่างโค้ดที่สามารถนำไปใช้ได้จริง</p>]]></description>
</item>
<item>
    <title>Structs, Enums และ Pattern Matching</title>
    <link>https://kawin.dev/posts/rust/rust-structs-enums/</link>
    <pubDate>Thu, 09 Jul 2026 09:00:00 &#43;0700</pubDate>
    <author>kawin.v@kkumail.com (Kawin Viriyaprasopsook)</author>
    <guid>https://kawin.dev/posts/rust/rust-structs-enums/</guid>
    <description><![CDATA[<div class="featured-image">
                <img src="/featured-image.jpeg" referrerpolicy="no-referrer">
            </div>สร้างประเภทข้อมูลของเราเองด้วย Structs และ Enums จัดการทุกกรณีอย่างปลอดภัยด้วย Pattern Matching]]></description>
</item>
<item>
    <title>เรียนรู้ Ownership, Borrowing และ Lifetimes</title>
    <link>https://kawin.dev/posts/rust/rust-ownership-borrowing/</link>
    <pubDate>Wed, 08 Jul 2026 09:00:00 &#43;0700</pubDate>
    <author>kawin.v@kkumail.com (Kawin Viriyaprasopsook)</author>
    <guid>https://kawin.dev/posts/rust/rust-ownership-borrowing/</guid>
    <description><![CDATA[<div class="featured-image">
                <img src="/featured-image.jpeg" referrerpolicy="no-referrer">
            </div><p>Ownership คือหัวใจของ Rust ที่ทำให้ปลอดภัยด้านหน่วยความจำโดยไม่ต้องมี Garbage Collector เชื่อมจากภาค 1 (<code>/posts/rust/rust-getting-started/</code>)</p>]]></description>
</item>
<item>
    <title>เริ่มต้นกับ Rust</title>
    <link>https://kawin.dev/posts/rust/rust-getting-started/</link>
    <pubDate>Tue, 07 Jul 2026 09:00:00 &#43;0700</pubDate>
    <author>kawin.v@kkumail.com (Kawin Viriyaprasopsook)</author>
    <guid>https://kawin.dev/posts/rust/rust-getting-started/</guid>
    <description><![CDATA[<div class="featured-image">
                <img src="/featured-image.jpeg" referrerpolicy="no-referrer">
            </div><h1 id="เรมตนกบ-rust">เริ่มต้นกับ Rust</h1>
<p>จุดเริ่มต้นของซีรีส์นี้มาจากโพสต์บน Facebook ที่เห็นจาก <a href="https://rayrag.com/" target="_blank" rel="noopener noreffer ">rayrag.com</a> ที่แสดงให้เห็นว่าเราสามารถเล่น <strong>Ragnarok Online (RO)</strong> บนเว็บเบราว์เซอร์ได้เลย ผ่านการเชื่อมต่อ WebSocket ไปยัง emulator server ของเกม นั่นทำให้ผมอยากรู้ว่ามันทำงานยังไง และอยากลองสร้าง WebSocket-to-TCP proxy ของตัวเองด้วยภาษาที่เร็วและปลอดภัย — นั่นคือจุดของการกลับมาทบทวน Rust อีกครั้ง และโปรเจกต์ <a href="https://github.com/bouroo/rs-wsProxy" target="_blank" rel="noopener noreffer ">rs-wsProxy</a></p>
<p>ทำไมต้อง Rust? เพราะมันให้ทั้งประสิทธิภาพระดับระบบ (ระดับ C/C++) ความปลอดภัยด้านหน่วยความจำโดยไม่ต้องใช้ garbage collector และรองรับการเขียนโปรแกรมแบบพร้อมกันได้อย่างปลอดภัย นี่เป็นบทแรกของซีรีส์ 8 ตอนที่จะพาคุณทบทวน Rust ไปจนถึงสร้าง WebSocket-to-TCP Proxy ที่ใช้งานจริงกับ roBrowser</p>]]></description>
</item>
</channel>
</rss>
