{"id":20410852,"url":"https://github.com/ates/radius","last_synced_at":"2025-04-12T16:05:25.950Z","repository":{"id":2937314,"uuid":"3949267","full_name":"ates/radius","owner":"ates","description":"RADIUS protocol","archived":false,"fork":false,"pushed_at":"2023-02-28T17:19:09.000Z","size":192,"stargazers_count":15,"open_issues_count":1,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-26T10:36:10.306Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ates.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2012-04-06T12:00:42.000Z","updated_at":"2023-04-11T15:16:50.000Z","dependencies_parsed_at":"2022-09-26T18:31:42.594Z","dependency_job_id":"fc8c8520-9b58-41ff-83d4-1abbf31702d3","html_url":"https://github.com/ates/radius","commit_stats":{"total_commits":68,"total_committers":2,"mean_commits":34.0,"dds":"0.014705882352941124","last_synced_commit":"dd9889cf2cc599c58568de4ca713839ba13a7c8e"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ates%2Fradius","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ates%2Fradius/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ates%2Fradius/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ates%2Fradius/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ates","download_url":"https://codeload.github.com/ates/radius/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248593738,"owners_count":21130312,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T05:48:42.836Z","updated_at":"2025-04-12T16:05:25.926Z","avatar_url":"https://github.com/ates.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"RADIUS protocol\n===============\n\n[![Build Status](https://secure.travis-ci.org/ates/radius.png)](https://travis-ci.org/ates/radius)\n\nREUSE_PORT\n----------\n\nTo make radius service utilize the REUSE_PORT feature just add the following to the sockets options:\n\n```erlang\n{reuseport, N}\n```\n\nWhere N is amount of workers which must be listen the port\n\nServer example\n--------------\n\n```erlang\n-module(server).\n\n-behaviour(radius_service).\n\n-export([start/0, stop/0, handle_request/3]).\n-export([handle_error/2]).\n\n-include(\"radius.hrl\").\n\n-define(SERVICE_NAME, test_radius_server).\n\nstart() -\u003e\n    {ok, _Started} = application:ensure_all_started(radius),\n    lists:foreach(fun radius_dict:add/1, radius_dict_file:load(\"dictionary\")),\n    Nas = #nas_spec{name = nas1, ip = {ip, {127,0,0,1}}, secret = \"testing123\"},\n    ServiceOpts = [\n        {ip, {0,0,0,0}},\n        {port, 1812},\n        {callback, ?MODULE}\n    ],\n    radius:start_service(?SERVICE_NAME, ServiceOpts),\n    radius:add_client(?SERVICE_NAME, Nas).\n\nstop() -\u003e\n    radius:stop_service(?SERVICE_NAME).\n\nhandle_request(Type, Request, Client) -\u003e\n    io:format(\"Type: ~p~nRequest: ~p~nClient: ~p~n\", [Type, Request, Client]),\n    Response = #radius_packet{code = ?ACCESS_ACCEPT, attrs = []},\n    {ok, Response}.\n\nhandle_error(Reason, Data) -\u003e\n    io:format(\"Reason: ~p, Data: ~p~n\", [Reason, Data]).\n```\n\nClient example\n--------------\n\n```erlang\n-module(client).\n\n-export([send/0]).\n\n-include(\"radius.hrl\").\n\nsend() -\u003e\n    {ok, _Started} = application:ensure_all_started(radius),\n    lists:foreach(fun radius_dict:add/1, radius_dict_file:load(\"dictionary\")),\n\n    {ok, Pid} = radius_client:start_link({127, 0, 0, 1}, 1812, \"testing123\"),\n\n    Attrs = [\n        {\"User-Name\", \"john\"},\n        {\"Password\", \"secret\"}\n    ],\n\n    Reply = radius_client:send(Pid, ?ACCESS_REQUEST, Attrs),\n\n    io:format(\"Reply: ~p~n\", [Reply]),\n\n    radius_client:stop(Pid).\n```\n\nLicense\n-------\n\nAll parts of this software are distributed under the Apache License, Version 2.0 terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fates%2Fradius","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fates%2Fradius","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fates%2Fradius/lists"}